PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > MySQL
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
Old 7-20-12, 04:01 AM   #1
PeterPan
 
Join Date: Sep 2002
Location: Auckland
Posts: 1,227
Reputation: 59
Unknown column in 'where clause'

Hello.

I've used MYSQL a bit - but no expert. I'm getting a confusing error..

PHP :-
Code:
SELECT * FROM `Worksheet` WHERE `Group_ID` = test;
Error :-

Quote:
ERROR -
Unknown column 'test' in 'where clause'
Now, i am NOT looking for a column named test - i want to see if 'test' is somewhere in the column Group_ID.

Can anyone advise where I am going on, & why is it treating a value like a column/field name.

EDIT :- I AM expecting 0 / zero results at this time, so i want to retrieve some useful response if its 0 results (or nore than 0 )

Later on, there will be 1 or more results

Last edited by PeterPan; 7-20-12 at 04:04 AM.. Reason: added edit text
PeterPan is offline   Reply With Quote
Old 7-20-12, 06:49 AM   #2
entrecon
Custom User Title
 
entrecon's Avatar
 
Join Date: Aug 2006
Location: Michigan
Posts: 2,669
Reputation: 337
I think it is in your quotes. Here is a sample I found:
Code:
SELECT * FROM Persons WHERE FirstName='Peter';
So, yours would read:
Code:
SELECT * FROM Worksheet WHERE Group_ID='test';
__________________
________________________________
Find me on twitter: @entrecon
entrecon is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:16 AM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.