Hi,

If I run a mysql query then work through the results of that query one at a time, deleting the record sometimes eg:

while (my $href = $sth->fetchrow_hashref())
{
  if ($href->{'ExpiryDate'} eq '2003-02-22 00:00:00') {
    # Do something
    # then...
    $db->do("DELETE FROM MyTable WHERE ID=$href->{'ID'}");
  }
  else {
    # Do something else
  }
}

Does the DELETE cause a change in the results of the surrounding $sth parsing loop?

I know it would be best to do a:

DELETE FROM MyTable WHERE ExpiryDate = whatever

But I need to use the data to do some other stuff, only from those records that are up for deletion.

Any ideas?

Thanks,


Jeff



--------------------------------------------------------------------- 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