I have error with this line
while($row = mysql_fetch_array($pregled)) in line 42
here is part of code that has problem, can anyone check this out? I need to fix this as soon as possible
thanks in advance
<p align="center"><font color="#0000FF">Pregled grupa</font></p>
<p align="center">Grupa kojoj koncert pripada:
<select name="grupa_select2" id="grupa_select2">
<?php
while($row = mysql_fetch_array($sql))
{
echo "<option>".$row['grupanaziv']."</option>";
}
?>
</select>
</p>
<p align="center">
<input type="submit" name="pregled_grupe" id="pregled_grupe" value="- Izaberi grupu-" />
</p>
<p>
<label></label>
</p>
<?php
if (isset($_POST['pregled_grupe'])) {
$con = mysql_connect($hostname,$db_username,$db_password);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($db_name, $con);
$selektovanje = mysql_query("select id from grupe where grupanaziv = '".($grupa_select2)."'");
$grupa_id = mysql_fetch_array($selektovanje);
$pregled = mysql_query("select * from koncerti where grupa_id = ".$grupa_id['id']."");
echo "Koncerti za izabranu grupu su: ";
while($row = mysql_fetch_array($pregled))
{
echo "<br>".$row['koncertnaziv'];
echo "<br>".$row['mesto'];
echo "<br>".$row['datum'];
echo "<br>".$row['karte'];
}
}
?>