Jump to content

query variable interpreted as column...but WHY?


WhiteRau

Recommended Posts

hello all!

 

my query, when executed, generates an error i don't understand.  :-\  i've seen similar entries, but i couldn't find one that related to this particular problem.  either that, or i'm a retard and didn't see it.  apologies if that's the case.  here's the error:

 

-->  Database Query Failed: Unknown column 'client_id' in 'where clause'  <--

 

i triple checked the database table and, YUP, the column is correctly named "client_id" and it is an INT column, so it doesn't need to be encapsulated with single quotes.

 

here's the code that makes it happen:

 

<CODE>

 

        $clientID = $_SESSION['clientID'];

 

$query = "SELECT * ";

$query .= "FROM client_data ";

$query .= "WHERE client_id = {$clientID} ";

$query .= "LIMIT 1";

 

$results = mysql_query($query);

 

</CODE>

 

what. the. heck.  :confused:

 

thanks in advance gang.  :P

 

WR!

Link to comment
Share on other sites

i deserve a mallet to the side of the head.  :'(  you were right: the column was from a pointer table. i'd been staring at it for hours, must've got brain-burn-in.

 

thank you for the speed reply and three more times for saving my from bashing myself unconscious on my keyboard.  :D

 

WR! 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.