Re: Where's the mix-up?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In article <004101c3c412$66e49e20$800101df@Root2>, robert@xxxxxxxxxxxx 
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?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux