Hello could someone help me know what could be a ploblem. I am getting Warning: mysqli_query(): Couldn’t fetch mysqli error.
<?php
// displaying list of regions and councils from database
$sql= "SELECT Regions.regioncode, Regions.regionname, Councils.councilcode, Councils.councilname FROM Regions INNER JOIN Councils ON Regions.regioncode = Councils.regioncode";
$result = mysqli_query($mysql_id,$sql);
if ($result->mysqli_num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr"."id="."data".">".
"<td>".$row['Regions.regioncode']."</td>".
"<td>".$row['Regions.regionname']."</td>".
"<td>".$row['Councils.councilcode']."</td>".
"<td>".$row['Councils.councilname']."</td>".
"</tr>";
}
} else {
echo "No region available";
}
// ending if statement
mysqli_close($mysql_id);
// end the connection after displaying the list of reports
echo "</table>";
?>