PDA

View Full Version : DELETE in various TABLES where IP starts with "134.196.97."


chrisvmarle
12-23-2002, 12:34 PM
Hi All,

I don't use MySQL a lot, but I have a problem with DELETE.

I have a database "logging" with various TABLES.

Now I want to DELETE all the ROWS from all the TABLES that have an entry starting with "134.196.97." in the field IP.

Any1 any idea?

Thanks in advance,
Mzzl, Chris

I do have phpMyAdmin and PHP access, so a PHP page that'll do this for me will do

WA
12-23-2002, 01:44 PM
Before you try this (or any major delete commands), I highly recommend backing up your database first. To your question, try something like:

delete from MYTABLE where IP like '134.196.97.%'

The percentage sign at the end tells mysql to match anything that contains the specified IP plus any additional text.