Re: Easy MySQL question

From: Date: Thu, 11 Jan 2001 17:37:55 +0000
Subject: Re: Easy MySQL question
References: 1 2 3 4  Groups: php.db 
Request: Send a blank email to php-db+get-5806@lists.php.net to get a copy of this message
Julie Meloni wrote: > simon wrote: > > > Julie Meloni wrote: > > > > > >> Paulson, Joseph V. \"Jay\" wrote: > >> > >> > >>> Hello everyone-- > >>> I've got a easy question that I can't seem to answer for myself. > >>> I'm > >>> running a query in MySQL and want to know how many entries are in a table > >>> and then echo that out onto a page. I thought this would be easy but I > >>> don't know why it's not working. Anyway, here's what I am doing: > >>> > >>> (open db connection) > >>> > >>> $query = "SELECT count(*) FROM Movie"; > >>> $result = mysql_query($sql, $dbLink); > >>> $myrow = mysql_result($result); > >>> echo $myrow; > >>> > >> > >> $myrow = mysql_result($result,0,"count(*)"); > >> > > > > > > Shouldn't this be $query also? > > > > $query = "SELECT count(*) FROM Movie"; > > $result = mysql_query(****$sql****, $dbLink); > > $myrow = mysql_result($result); > > echo $myrow; > > > > Yes; I wasn't paying attention to that, just the use of the > mysql_result() function. > > -- > +------------------------------------------------+ > | Julie Meloni (julie@i2ii.com) | > | Tech. Director, i2i Interactive (www.i2ii.com) | > | | > | "PHP Essentials" & "PHP Fast & Easy" | > | http://www.thickbook.com/ | > +------------------------------------------------+ > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net Sorry, I didn't see that I was replying to your reply. I thought you were the original sender. Perhaps you could help me with my Q above??? I'm pulling my hair out here! -- Simon Pospisil Mail: simon.pospisil@fastsearch.com Web Engineer Web: http://www.fastsearch.com/ Fast Web Media Ltd. Phone: +44 (0) 161 835 3444 Suite 1202, Sunlight House Quay Street Fax: +44 (0) 161 835 3488 Manchester, England M3 3JZ Try FAST Search: http://www.alltheweb.com

« previous php.db (#5806) next »