List:General Discussion« Previous MessageNext Message »
From:Jay Blanchard Date:May 10 2005 11:35am
Subject:RE: DATA TYPE QUESTIONS?
View as plain text  
[snip]
IF I use the following statement:
SELECT  *  FROM  `items`  WHERE  `item` = 10902 HAVING  `venturi_type` 
= 'universal' OR `venturi_type` = 'special';
I get a complete and full data dump.

IF I change the statement by inserting a 'letter' in this case 'S' 
instead of a 'number' in this case '0' in the 'item', i.e. from 10902 
to 109S2 I get the following error:
#1054 - Unknown column '109S2' in 'where clause

IF I change the statement by putting single quotes around '109S2' then 
I get an SQL execution completed result from phpMAdmin, but NO data 
dump!

The column 'venturi_type' is the same NO MATTER what part number 'item' 
is and should display, yet it does not.

Why should it make a difference wether I have a letter or a numeral in 
a part number?
[/snip]

Because the part number may be a string, not a number. Oh sure, it looks
like a number, but it is really a string. Also, the venturi_type should
be a conditional other than a HAVING....try this...

SELECT  *  
FROM  `items`  
WHERE  `item` = '10902' <--(note single quotes around string)
AND (`venturi_type` = 'universal' OR `venturi_type` = 'special');
Thread
DATA TYPE QUESTIONS?Tommy Barrios10 May
Re: DATA TYPE QUESTIONS?Tommy Barrios10 May
RE: DATA TYPE QUESTIONS?Jay Blanchard10 May
RE: DATA TYPE QUESTIONS?Jay Blanchard11 May