Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: deleting from a mysql database

by mpolo (Chaplain)
on Jan 06, 2004 at 14:05 UTC ( [id://319119]=note: print w/replies, xml ) Need Help??


in reply to deleting from a mysql database

Not really an answer to your question, but you don't need to escape (backslash) the quotation marks inside of a qq(). Also, the backticks around Name are unnecessary in mysql.

The reason that your code doesn't work is that the first time through the loop, you delete everything that is not "Anna". The second time through, you delete everything that is not "Maria" (which is everything in the database). The third time, there is nothing left to delete...

Another monk has already provided code using IN, which should be effective, but slow. It all depends on database sizes...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://319119]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-19 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found