Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
Zoram
Forum Contributor
Posts: 166 Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:
Post
by Zoram » Sun Oct 20, 2002 4:54 pm
їcode]Could not execute query:
SELECT * FROM `Products` WHERE `id` = 'ba03';
Unknown column 'ba03' in 'where clause'ї/code]
How do i get it to work? the id is a varchar... it works when the ba03 is a number with no characters...
protokol
Forum Contributor
Posts: 353 Joined: Fri Jun 21, 2002 7:00 pm
Location: Cleveland, OH
Contact:
Post
by protokol » Sun Oct 20, 2002 10:46 pm
Try putting it in double quotes: "ba03" ... also make sure that your id column can take a value other than a number
Zoram
Forum Contributor
Posts: 166 Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:
Post
by Zoram » Sun Oct 20, 2002 11:25 pm
The variable type of id is varchar. And the double quotes didn't work.
phpScott
DevNet Resident
Posts: 1206 Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.
Post
by phpScott » Mon Oct 21, 2002 1:39 am
Are you absolutely sure that 'id' is a varchar. I ran a quick test on a test db i run on my machine and using id and name as test columns and inserted 'ba03' in the id column and it was happy.
I would double check your your table definition and see what it says.
phpScott
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Mon Oct 21, 2002 1:57 am
even if it wasn't varchar it would not produce an sql-error in a WHERE clause.
But anyway this problem is (hopefully) history