How can I see how many rows the following query returns?
mysql_select_db($database_aoldatabase, $aoldatabase);
$query1 = \"select * from sale where secid =
Like Michiel said, mysql_num_rows()
do the job. But if you want to work with more than one rows using an array, you can use count()
too.
$data = array();
while($row = mysql_fetch_array($maxa, MYSQL_ASSOC)) {
$data[] = $row;
}
$count1 = mysql_num_rows($maxa);
$count2 = count($data);
Use the function mysql_num_rows()
Have a look at: http://nl3.php.net/manual/en/function.mysql-num-rows.php