I am having a problem with a little php showing script i wrote. I cant get the code to show in the Table. What am i doing wrong? Cant find the answer somewhere either...
Error code: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in
$con=mysqli_connect("localhost","database_connected","password");
// Check connection
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM links");
echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['links'] . "</td>";
echo "<td>" . $row['url'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);