RE: Need help with Database and variables
| From: | Tim Ward | Date: | Tue, 08 May 2001 07:48:34 +0000 |
| Subject: | RE: Need help with Database and variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51868@lists.php.net to get a copy of this message | ||
$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:php@elghund.com]
> Sent: 07 May 2001 21:34
> To: Php-General@Lists.Php.Net
> 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:ryan@ramulus.com
>
>