I'm running following query in phpMyAdmin and I receive the expected results, but when I try to display it with PHP I can't see anything in browser and any error message as well!
Hier the code:
// Displays the erros.
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
// Here the query
$query = "
SELECT
p.auth,
p.nr,
p.kind,
(SELECT i.family FROM table02 i WHERE p.family = i.family LIMIT 1) family,
(SELECT group_concat(i.class) FROM table03 i WHERE p.family = i.family) class,
(SELECT a.appl FROM table04 a WHERE p.family = a.family) appl,
p.date,
(SELECT s.sim FROM table05 s WHERE p.family = s.num2 LIMIT 1) sim
FROM
table01 p
WHERE
p.family = 1
ORDER BY sim DESC";
$result = mysqli_query($link, $query) or die ("Couldn't execute query: ".mysqli_error());
// Echoes the table with the result of the query.
echo "<table>
";
while($row = mysqli_fetch_array($result))
{
echo "<tr>
";
echo "<td>".$row['auth']$row['nr']$row['kind']."</td><td>".$row['family']."</td><td>".$row['class']."</td><td>"."</td><td>".$row['appl']."</td><td>"."</td><td>".$row['date']."</td><td>"."</td><td>".$row['sim']."</td>
";
echo "</tr>
";
}
echo "</table>
";
First of all, what I should do to receive a feedback from PHP showing the possible wrong lines of the code?
Moreover, is there any problem by display of the table? I have a very similar code that display another query very well. The only difference is that the query is not so complex like this one we have here. But I don't believe that the query is wrong, because it works fine in phpMyAdmin giving me the expected results.
Many thanks in advance for your help!