Re: newbie: MySQL Problem or severe ignorance..

From: Date: Wed, 02 Jan 2002 21:45:19 +0000
Subject: Re: newbie: MySQL Problem or severe ignorance..
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15318@lists.php.net to get a copy of this message
Hello: I would actually disagree with rhelms@mayn.de. The mysql_query() function does not require both database and query as arguments, only query. The mysql_db_query() function does, thus the function name. Using mysql_query() with database as a parameter would actually be incorrect. (See the PHP manual for details on these two functions?) I can't tell from the code snippet, but it may not be working because there's no database connection defined. Cheers, db rhelms@mayn.de wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Chris Hogben, > > > I've just been looking at this snippet, and wondering why it's not working.. > > Either i'm doing something wrong, or i'm just totally ignorant.. (More > > likely the latter). But if anyone can help me out, please let me know.. > > > > --- > > > > $query = "SELECT * from counter"; > > $result = mysql_query($query); > > incorrect - must be mysql_query($database,$query); > > or better you use mysql_db_query(...), in this case a > id will generated if no id for the query-executing is generated. > > > $numone = mysql_numrows($result); > > $i = 0; > > while ($i <= $numone) { > > $seekrow = mysql_data_seek($result, $i); > > $fetchrow = mysql_fetch_row($result); > > $time = $fetchrow["time"]; > > echo "$i = $time<br>"; > > $i++; > > } > > > > --- > > > > > > > > -- > > 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 > > - ---------------------------------- > E-Mail: rhelms@mayn.de > Date: 01-Jan-2002 > Time: 13:48:00 > > This message was sent by XFMail > - ---------------------------------- > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: Weitere Infos: siehe http://www.gnupg.org > > iD8DBQE8MbCfEK4asBW3N7wRArMPAKC2GPb8uwDgEUn2dOZG2B2PkXESSACgkDIQ > oFxpZgl8eue2n39eG71O0uw= > =DK3J > -----END PGP SIGNATURE----- > > -- > 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 -- ---------- Dan Barton Terrestrial Program Biologist Data Manager Point Reyes Bird Observatory http://www.prbo.org dbarton@prbo.org dbarton@grayflycatcher.org

« previous php.db (#15318) next »