I have this error: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\projeto\BD\proj_detalhes.php on line 25
<?php
$bd = "crowdfunding";
$connection = mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db($bd) or die(mysql_error());
$sql = "SELECT projeto.id, nome, limite, projeto.descricao FROM projeto,(SELECT valor, recompensa.descricao FROM recompensa, projeto WHERE projeto.id = id_projeto)";
$res = mysql_query($sql);
?>
<html>
<head>
<title>Projects</title>
</head>
<body>
<h1>Details<br /></h1>
<table>
<tr>
<td><strong>ID</strong></td>
<td><strong>Name</strong></td>
<td><strong>Final data</strong></td>
<td><strong>Description</strong></td>
<td><strong>Value</strong></td>
<td><strong>Reward Description</strong></td>
</tr>
<?php
while($dados = mysql_fetch_array($res)){
$id = $dados['id'];
$nome = $dados['nome'];
$data = $dados['limite'];
$descricao_proj = $dados['projeto.descricao'];
$valor = $dados['valor'];
$descricao_rec = $dados['recompensa.descricao'];
echo "<tr>
<td>$id</td>
<td>$nome</td>
<td>$data</td>
<td>$descricao_proj</td>
<td>$valor</td>
<td>$descricao_rec</td>
</tr>";
}
?>
</table><br /><br />
<form action="menu1.php" method="get">
<center><input name="button" type="submit" value="Back"/></center>
</form>
</body>
</html>
My first variables are not in english, try to understand it. But my goal in here is to show from project table my ID name and description and from my reward table i want to show value and description (only if id from project is equal to the variable i created project_id)