$result = mysql_query($db, "SELECT count(*) AS song_count FROM table_name");
if ($array = mysql_fetch_array($result)) $song_count = $array("song_count");
Tim Ward
Senior Systems Engineer
Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html
> -----Original Message-----
> From: Ryan W. Zajicek [mailto:[EMAIL PROTECTED]]
> Sent: 07 May 2001 21:34
> To: [EMAIL PROTECTED]
> Subject: Need help with Database and variables
>
>
> Hello,
>
> I was wondering if I do a database query like "SELECT count(*) FROM
> table_name AS song_count" if there is a way I can assign
> song_count to a
> variable that is accessable anywhere on the page and not just
> in a "WHILE"
> statement?
>
> Thanks is advance
>
> Ryan
> mailto:[EMAIL PROTECTED]
>
>
--
PHP General 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]