I know this question looks like repeated, but I really read a lot but doesn't solve the problem.
I want to echo the last 10 rows in sql and I get this error.
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\rock\fyp\postAdv.php on line 10
THE Event:
THE Date:
THE Time:
THE Venue:
Note:
the php file is
<?php
$con=mysqli_connect("rock","mido","1234","fyp");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$start = 10;
$result = mysqli_query($con,"SELECT * FROM event ORDER BY ID DESC LIMIT $start,10");
$row = mysqli_fetch_array($result) ;
{
echo "<br><h4> " . "THE Event: " . $row['EventName'] . "</br>";
echo "<h4>" . "THE DATE: " . $row['Date'] ;
echo "<h4>" . "THE TIME: " . $row['Time'] ;
echo "<h4>" . "THE Venue: " . $row['Venue'] ;
echo "<h4>" . "Note: " . $row['Note'] ;
}
mysqli_close($con);
?>