I want to highlight only the first 10 rows, but I need to calculate the total number of rows affected by the query.
I did LIMIT 10and then counted with the obvious problem, which I was getting 10 as a bill.
What would be the right way to do this?
$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'];
}
source
share