Can someone explain me why this query is not working ? I tested the query in phpmyadmin and its working but inside the php code its not returning anything, no result and no rows, I even test if the query is executed and it returns false.
$queryAuchan = "SELECT dtOrt, tblport.dtName, dtGebäude, fiStandortcode
FROM tblport, tblstation, tblstandort WHERE tblport.idPort = tblstation.fiPort AND 
tblstandort.idStandortcode = tblstation.fiStandortcode AND fiStandortcode = 1 AND tblport.dtPortstatus = 0";
$resultAuchan = mysqli_query($mysqli, $queryAuchan);
$numres = mysqli_num_rows($resultAuchan);
echo "<table border='0' style='text-align: center'>";
echo "<tr>";
echo "<th style='text-align: center'>Ort</th>";
echo "<th style='text-align: center'>Port</th>";
echo "<th style='text-align: center'>Gebäude</th>";
echo "<th style='text-align: center'>Reservieren</th>";
echo "</tr>";
for ($i = 0; $i < $numres; $i++) {
    $row = mysqli_fetch_array($resultAuchan);
    $string = $row[1];
    $portnr = substr($string, -1);
    $location = $row['dtOrt'];
    $portname = $row['dtName'];
    $building = $row['dtGebäude'];
    echo "<tr>";
    echo "<td>" . $location . "</td>";
    echo "<td>" . $portname . "</td>";
    echo "<td>" . $building . "</td>";
    echo "<td><button type='submit' name='activate' value='" . $portnr . "'>Activate</button>";
    echo "</tr>";
}
echo "</table>";
 
    