RE: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread -{ Rene Brehmer }-
so close heh ... thanks mate :) and whether they're to actually be deleted, that depends on the application ... I have a few different where I use it. Rene At 02:13 03-11-2004, Bastien Koert wrote: DELETE FROM the_table WHERE `ID` IN(1,2,3,4,5,6) will work just fine. The trick is to be sure

Re: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread -{ Rene Brehmer }-
At 02:37 03-11-2004, Jennifer Goodie wrote: [snip] > My current version generates, for multi-select cases, queries like this: > > DELETE FROM the_table WHERE `ID`='1' OR ID`='2' OR `ID`='3' OR `ID`='4' OR > `ID`='5' OR `ID`='6' > > or similar with the SELECT statement. [snip lots of stuff] > DELETE

Re: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread Jennifer Goodie
-- Original message -- From: -{ Rene Brehmer }- <[EMAIL PROTECTED]> > Task at hand: deleting or selecting (same difference) several numbers of > records using only 1 query. > > My first version simply looped through all the ticked off IDs and ran a > single query

RE: [PHP-DB] Using an array(-ish) in SQL queries

2004-11-02 Thread Bastien Koert
DELETE FROM the_table WHERE `ID` IN(1,2,3,4,5,6) will work just fine. The trick is to be sure that those records indeed are to be deleted. I prefer to mark the record as deleted for a time before permanent deletion. That way its recoverable should something really bad happen. bastien From: -{