Re: COUNT(*) problem - mysql
Try this:
$db=mysql_connect('hostname', 'usenamne', 'password');
mysql_select_db('databasename',$db);
$sql="SELECT COUNT(*) FROM love WHERE male = '1' ";
$ret=mysql_query($sql);
$row=mysql_fetch_row($ret);
$malenumber=$row[0];
or this
$db=mysql_connect('hostname', 'usenamne', 'password');
mysql_select_db('databasename',$db);
$sql="SELECT * FROM love WHERE male = '1' ";
$ret=mysql_query($sql);
$malenumber=mysql_numrows($ret);
Subject
Written By
Posted
Re: COUNT(*) problem - mysql
June 13, 2005 11:04AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.