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 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]'; 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 Link to comment https://forums.phpfreaks.com/topic/214778-delete-with-regex/#findComment-1117422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.