How to list the last 10 rows in sql ?
I've used "SELECT * FROM event ORDER BY ID DESC LIMIT 1"
before and its was effective for me, thought playing with it might works.
I used "SELECT * FROM event ORDER BY ID DESC LIMIT 10"
"SELECT TOP 10 * FROM event ORDER BY ID DESC LIMIT 1"
and "SELECT * FROM event ORDER BY ID DESC LIMIT 10,999999" but doesn't work.
this is the php file
<?php
$con=mysqli_connect("rock","mido","1234","fyp");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM event ORDER BY ID DESC LIMIT 1");
$row = mysqli_fetch_array($result) ;
{
echo $row['EventName'] . $row['Date'] . $row['Time'] . $row['Venue'] . $row['Note'];
}
mysqli_close($con);
?>
and the most important, is there anyway to make display as one by one?
I should I try marquee
with with it ?