hi, is there an easy quick way of returning the number of records within a database? Without haveing to retrieve all...
if you want the number of records returned from a query you can run the query and then do mysql_num_rows. If you're after the total number of rows in the whole database then I'm not sure if there's and easy way. HTH Rob
select count(*) from table limit 1
I cant seem to get that to work... gives me resource id #8...
that will work when u run it in the db directly, the resource id msg u get cause u havent used it properly in the php code. post ure code
reg kevin
I deleted it, and used the one above... for now...
what function must i use with it, and then what must i do to get it into a variable?
//connect to db $query = "select count(*) from tablename"; $result = mysql_query($query); $row = mysql_fetch_array($result); echo "no of rows is ".$row[0];