1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <?php
$sql = "select id_patient, id_therapeute from therapeute_patient where id_patient = $idpatient ORDER BY id ASC";
$resA = mysql_query($sql) or die(mysql_error());
echo 'nbRec 1 :', mysql_num_rows($resA), '<br />';
while($data = mysql_fetch_assoc($resA)) {
$sql = "select nom, prenom, specialite from therapeutes where id = ".htmlentities($data['id_therapeute']);
$resB = mysql_query($sql) or die(mysql_error());
echo 'nbRec 2 :', mysql_num_rows($resB), '<br />';
$row = mysql_fetch_assoc($resB);
echo htmlentities($row['nom']), ' ',
htmlentities($row['prenom']), ' [',
htmlentities($row['specialite']), '] <br />';
}
?> |