sastro Posted September 29, 2010 Share Posted September 29, 2010 Here is my table CODE | NAME 001 | Mayhem 002 | 3434 003 | just1 . . . How to delete record with no char ( In PHP !preg_match('/[a-z]/i',$str) ) based on field NAME? So the list will looks like CODE | NAME 001 | Mayhem 003 | just1 . . . Thank you in advanced Quote Link to comment https://forums.phpfreaks.com/topic/214778-delete-with-regex/ Share on other sites More sharing options...
mikosiko Posted September 30, 2010 Share Posted September 30, 2010 test first with a SELECT instead of DELETE to be sure it works ok (it should) SELECT * FROM table WHERE NOT name REGEXP '[a-z]'; Quote Link to comment https://forums.phpfreaks.com/topic/214778-delete-with-regex/#findComment-1117418 Share on other sites More sharing options...
sastro Posted September 30, 2010 Author Share Posted September 30, 2010 Ok, it works. Also DELETE FROM table WHERE name NOT REGEXP '[a-z]'; Thanks Quote Link to comment https://forums.phpfreaks.com/topic/214778-delete-with-regex/#findComment-1117422 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.