<? $result = mysql_query("SELECT COUNT(id) as id FROM table); $myrow = mysql_fetch_array($result); print "$myrow[id]"; ?>
Mike ----- Original Message ----- From: "Ron Allen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, April 11, 2002 7:13 AM Subject: [PHP-DB] Re: count > I know how to get the results for the total number of records > select count(*) from $table > but how do I put them into a variable for me to use later??? > > "David Robley" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > In article <[EMAIL PROTECTED]>, > > [EMAIL PROTECTED] says... > > > I would like to count all the total records from a database. How would > I go > > > about doing that??? > > > > Do a COUNT * on each table and total the results? Although the results > > may actually not mean much depending on your DB structure. Or do you > > really mean count records in a _table_? > > > > -- > > David Robley > > Temporary Kiwi! > > > > Quod subigo farinam > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.330 / Virus Database: 184 - Release Date: 2/28/02 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php