Re: Where's the mix-up?
| From: | David Robley | Date: | Fri, 19 Dec 2003 00:12:53 +0000 |
| Subject: | Re: Where's the mix-up? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32124@lists.php.net to get a copy of this message | ||
In article <004101c3c412$66e49e20$800101df@Root2>, robert@gcnorris.com
says...
> Help:
>
> <snip>
> $sql = "select id1 from GCN_Salesmen where username = '$PHP_AUTH_USER'";
> $user_id = mysql_query($sql) or die(mysql_error());
> </snip>
>
> Produces: You have an error in your SQL syntax near 'id #2' at line 1
>
> <snip>
> $sql = "select id1 from GCN_Salesmen where username = $PHP_AUTH_USER";
> $user_id = mysql_query($sql) or die(mysql_error());
> </snip>
> Produces: Unknown column 'robert' in 'where clause'
>
> I have even tried like instead of = and still getting errors. I know
> this is a stupid error, but...
>
>
> Thanks,
> Robert
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Money is like manure - it is meant to be spread around.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
Try
$user_id = mysql_query($sql) or die(mysql_error()."<BR>Query<BR>".$sql);
so you can check your SQL; post the results if you cannot resolve it
yourself.
Cheers
--
Quod subigo farinam
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?