Hi List, 

I need to select a set of stuff from the database and then delete
exactly the same stuff.  I've formed two query statements and I'm
tacking modifications to their ends to be consistent, but I'm not sure
if with a limit clause the database will delete the same set of contents
selected?  Here's what I'm doing (in pesudocode):

query = "SELECT * FROM log where id in (idlist) ";
dquery = "DELETE FROM log where id in (idlist) ";

(if test1) querymod = "AND message like '%include%' ";
(if test2) querymod .= "AND message not (like '%exclude%') ";
(if test3) querymod .= "LIMIT 1000";

query = query + querymod;
dquery = dquery + querymod;

mysql_query(query);
fetch_and_prepare_results();

(if delete_shown) mysql_query(dquery);

display_results();

.. So, in this case is there any way I can guarantee that the items
deleted are the same ones that get displayed?  Is there any way I can do
this without including a unique identifier column and linking the delete
statement into that?

Thanks, 
Eric Mayers
Software Engineer I
Captus Networks










---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to