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 the obvious problem I kept getting 10 as the count.
What would be a proper way to do it?
$data = mysql_query("SELECT * FROM Badges WHERE UID = '$user' ORDER by Date DESC");
$count = mysql_num_rows($data);
while($row = mysql_fetch_array( $data ))
{
echo $row['Site'];
}