Re: MySQL error

From: Date: Tue, 10 Oct 2000 02:00:45 +0000
Subject: Re: MySQL error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19279@lists.php.net to get a copy of this message
Thanks =) ----- Original Message ----- From: "Joao Prado Maia" <jpm@kefta.com> To: "Brian Rue" <dwjw@quixnet.net> Cc: <php-general@lists.php.net> Sent: Monday, October 09, 2000 6:11 PM Subject: Re: [PHP] MySQL error On Mon, 9 Oct 2000, Brian Rue wrote: > I'm getting the following error: > Warning: Supplied argument is not a valid MySQL result resource ..... > > Here's the code: > $query="SELECT * FROM games WHERE > genre=$gameone_genre&number=$gameone_number"; > $info=mysql_query($query,$db); > $row=mysql_fetch_row($info); > > The last line is the one causing the error. What am I doing wrong? Hi Brian, That means that your result set is empty, so you are actually trying to fetch a "row" that does not exist. You have an error on your SQL query, since as far as I know, you should write $sql = "SELECT * FROM games WHERE genre=$gameone_genre AND number=$gameone_number"; Also, if the column named "genre" is a CHAR or VARCHAR, you should quote the query like this $sql = "SELECT * FROM games WHERE genre='$gameone_genre' AND number=$gameone_number"; Regards, Joao -- Joao Prado Maia Web Developer Kefta, Inc. T: (415) 391-6881 ext 8008 F: (415) 391-7079

« previous php.general (#19279) next »