WhiteRau Posted April 28, 2011 Share Posted April 28, 2011 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. thanks in advance gang. WR! Quote Link to comment https://forums.phpfreaks.com/topic/234948-query-variable-interpreted-as-columnbut-why/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 28, 2011 Share Posted April 28, 2011 That column doesn't exist in that table. Check your spelling and for any white-space/non-printing characters as part of the column name. Quote Link to comment https://forums.phpfreaks.com/topic/234948-query-variable-interpreted-as-columnbut-why/#findComment-1207424 Share on other sites More sharing options...
WhiteRau Posted April 28, 2011 Author Share Posted April 28, 2011 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. WR! Quote Link to comment https://forums.phpfreaks.com/topic/234948-query-variable-interpreted-as-columnbut-why/#findComment-1207427 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.