|
Posted by Gordon Burditt on 11/01/07 01:44
>DELETE FROM the_table WHERE bar='%'
>
>meaning, delete all records from the_table.
No, that's not what it means.
DELETE FROM the_table WHERE bar LIKE '%'
means delete all records from the_table. The first query means delete
all records where bar is of length one and contains a single percent sign.
Lesson here: use = instead of LIKE unless you actually *need*
pattern-matching. Also, turn off register_globals.
[Back to original message]
|