I am searching data from multiple tables in an SQL database and displaying in a PHP webpage.
However, I have an error :
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\projets\simple_veto\rdv_liste.php on line 71
Here is the query :
<table class="table table-sm table-dark">
<tr>
<th>Client</th>
<th>Médecin</th>
<th>Animal</th>
<th>Cabinet</th>
<th>Date</th>
<th>Heure</th>
</tr>
<!-- Script de liste -->
<?php
//On recupere les informations
$req = mysql_query('SELECT rdv.client, rdv.medecin, rdv.animal, rdv.cabinet, client.nom, medecin.nom, animal.nom, cabinet.nom, date_rdv, time FROM client, medecin, animal, cabinet WHERE rdv.client=client.id_cli AND rdv.medecin=medecin.id_med AND rdv.animal=animal.id_ani AND rdv.cabinet=cabinet.id_cab');
while($dnn = mysql_fetch_array($req))
{
?>
<tr>
<td class="left"><?php echo htmlentities($dnn['client'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['medecin'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['animal'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['cabinet'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['date_rdv'], ENT_QUOTES, 'UTF-8'); ?></td>
<td class="left"><?php echo htmlentities($dnn['time'], ENT_QUOTES, 'UTF-8'); ?></td>
</tr>
<?php
}
For information,
My database is as follows :
Table rdv - containing the following rows : id_rdv,client, medecin, animal, cabinet, date_rdv, time
In this table:
- client is a foreign key of -> table client
- medecin is a foreign key of -> table medecin
- animal is a foreign key of -> table animal
- cabinet is a foreign key of -> table cabinet
A little help would be greatly appreciated,