Re: MySQL error
| From: | David Robley | Date: | Tue, 10 Oct 2000 01:13:08 +0000 |
| Subject: | Re: MySQL error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19275@lists.php.net to get a copy of this message | ||
On Tue, 10 Oct 2000, Brian Rue wrote:
> Hi,
>
> 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?
>
Not reading the FAQ? Use mysql_error() after your database call to see what
error is being returned. At a guess I'd say that the lack of spcaes in yuor
SQL query could be a problem; also if either of the fields you are trying
to insert are type char you need to delimit the value being inserted with
single quotes.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA