dweb Posted May 5, 2012 Share Posted May 5, 2012 Hi Im working if someone can help me. I have a small form on my website which saves the data to a sql database. It seems like someone has been spamming it I need to write a query or script to try and pickup these spam entries, can someone advise me They seem to have used the format {letter} {word} {6digit number} {@ domain} for example e.wood876586@googlemail.com b.david212134@earthlink.net g.roads992126@yahoomail.com I believe these are spams as I have around 15,000 entries in this exact format I have since added something to stop these spammers, but I want to clean up all the old spam entries Thanks very much Dave Quote Link to comment Share on other sites More sharing options...
awjudd Posted May 5, 2012 Share Posted May 5, 2012 The WHERE clause below should capture what you are looking for. Use it as the SELECT first to see if it hits everything that you want it to and nothing more, and then you can throw it onto a DELETE. SELECT * FROM `emailtest` WHERE emailaddress REGEXP '[a-z]\.[a-z]+[0-9]{6}@.*' ~awjudd Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.