I use phpMyAdmin , the request itself works there. It is necessary to display in the table the dog, the owner and the type of certificate.
<? include 'db_connect.php'; $n = mysql_query("SELECT * FROM applications WHERE type ='titul'"); for ($i=0; $i<mysql_num_rows($n); $i++) { echo "<tr>"; $num = mysql_fetch_array($n); $dogs = mysql_query("SELECT * FROM dogs WHERE user_id='$num[user_id]'"); $d = mysql_fetch_array($dogs); $owner = mysql_query("SELECT 'certificate_application.dog_id', 'certificate_application.user_id', 'certificate_application.app_id', 'certificate_application.certificate', 'users.user_name', 'dogs.dog_name' FROM 'certificate_application, users', 'dogs' WHERE 'certificate_application.user_id' = 'users.user_id' AND 'certificate_application.dog_id' = 'dogs.dog_id'"); $d = mysql_fetch_array($owner); echo "<td>".($i+1)."</td>"; echo "<td>".$num[date]."</td>"; echo "<td>".$d[dog_name]."</td>"; echo "<td>".$d[user_surname] ."</td>"; echo "<td>".$d[certificate]."</td>"; // echo "<td>".$num[status]."</td>"; ?>
$dogs = mysql_query("SELECT * FROM dogs WHERE user_id='{$num[user_id]}'");- ilyaplot