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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.