[thelist] daft mySQL query (v 3.23.39)

Joshua Olson joshua at waetech.com
Wed Jul 28 07:46:30 CDT 2004


> -----Original Message-----
> From: john at johnallsopp.co.uk
> Sent: Wednesday, July 28, 2004 7:44 AM
>
> SELECT * FROM `STOPWORDLIST` WHERE STOPWORDLIST_word = 'the'; returns no
> result line (in PHPadmin) (and mysql_num_rows($result) returns 0), whereas
>
> SELECT * FROM `STOPWORDLIST` WHERE STOPWORDLIST_word <= 'the'; returns all
> the words including the.

John,

Are you sure the value in the table is EXACTLY the?  Is there any chance
that the value in the table has any whitespace in it?

Question: when you use <=, does it return words that are alphabetically
after the word "the"?

Lastly, bear in mind that in some character sets, UPPERCASE letters are
before lowercase letters.  So, if the comparison is case-sensitive, then <=
'the' would indeed return all values if the values are stored as UPPERCASE
whereas it would return nothing for the straight =.  If the comparisons are
case-insensitive, then this should work unless the values are not exactly
equal (again, I'd suggest looking for whitespace).

> Or am I using the wrong coloured = today?

Too funny!

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168




More information about the thelist mailing list