MySQL is evil! Yes, very, very, evil...
Anyone care to tell me why or how MySQL believes this:
DELETE FROM cats WHERE catID LIKE 123-11-11
means delete everything in the stupid table!?!?
To explain:
I have a table, filled with info about cats for a cat shelter, each cat has an ID that is a varchar and looks like so: 123-1-12. I didn't make the ID's up - they were that way when I got here. Anyway it was late and I forgot to quote the string. It deleted every entry in the table. Not 0 affected rows, not an error, just delete everything. Using like to compare a varchar field to a set of numbers with a dash in them will delete everything in the table, if you just have a number it behaves as it should, the moment that dash enters the picture good-bye data. *mutter*
- DW |