Where's the mix-up?
| From: | Robert Sossomon | Date: | Tue, 16 Dec 2003 20:23:00 +0000 |
| Subject: | Where's the mix-up? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32087@lists.php.net to get a copy of this message | ||
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~