I want to echo only the first 10 rows, but I need to count the total number of rows affected by the query.
I was doing a LIMIT 10
and then counting with
count all records
$data = mysql_query("SELECT * FROM Badges WHERE UID = '$user' ORDER by Date DESC");
$count = mysql_num_rows($data);
echo "No of Records is :" . $count;
print 10 records...
$data = mysql_query("SELECT * FROM Badges WHERE UID = '$user' ORDER by Date DESC LIMIT 0, 10");
while($row = mysql_fetch_array( $data ))
{
echo $row['Site'];
}