Hi,
I'm having some problem with this code:
<?PHP
include 'topo.php';
include 'db_connect.php';
?>
<table>
<tr>
<td id="navigation-block">
<img src="background.jpg" id="hide" />
<ul id="sliding-navigation">
<?PHP
$sql = "SELECT * FROM cursos";
$query = mysql_query($sql,$connect);
while ($row = mysql_fetch_array($query))
{
?>
<li class="sliding-element"><a href="prog_curso.php?cod= <?PHP echo $row['cod_curso']; ?> "> <?PHP echo $row['nome_curso']; ?> </a></li>
<?PHP
;}
?>
</ul>
</div>
</td>
<td width="5%">
</td>
<td>
PROGRAMAÇÃO:
<br/>
<?PHP
$sql_prog = "SELECT prog_curso FROM cursos WHERE cod_curso=".$row['cod_curso'];
$query_prog = mysql_query($sql_prog, $connect);
while ($row = mysql_fetch_array($query_prog))
{
echo $row['prog_curso'];
}
?>
</td>
</tr>
</table>
<?PHP
include 'rodape.php';
?>
Gives me this error:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\site\prog_curso.php on line 41
Line 41:
while ($row = mysql_fetch_array($query_prog))