finding and deleting string match in mysql
Posted: Fri Jul 08, 2011 12:40 am
I am wondering if there is a way to find and delete from a mysql table that begins with a certain string.
$string = 'abc'
and in mysql table there is a column 'name'
name
=====
abc
abcdef
abc123
aewfabc
aabc
When I run the code, it should delete three rows 'abc', 'abcdef', and 'abcd123'.
Is there a way to do this? I am not sure if there is a mysql query option to do this.. or should I implement strpos() some how?
$string = 'abc'
and in mysql table there is a column 'name'
name
=====
abc
abcdef
abc123
aewfabc
aabc
When I run the code, it should delete three rows 'abc', 'abcdef', and 'abcd123'.
Is there a way to do this? I am not sure if there is a mysql query option to do this.. or should I implement strpos() some how?