Try the following:

$sql = "select count(*) as c from your_table" ;
$result = mysql_query(your_db, $sql, your_connection_identifier) ;
$row_count = mysql_result($result, 0, 'c') ;

Now $row_count contains the number of rows in your table named "your_table"

HTH

--Sam Masiello


"Andy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi there,
>
> I am trying to find out the number of rows in a table. The mysql docu says
> there is a mysql_num_rows statement but it requiers a sql statement in
> front. How could I do this more efficiently? Can anybody make an example,
> please? I am sure that there is an more easy way.
>
> Cheers Andy
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to