I’d like to write shortcut for this code
for example , i’m going to delete many entries if it have certain words from db my_table {id,my_words}
$sql= "delete from my_table where my_words like '%some1%' or my_words like '%some2%'";
mysql_query($sql) or die("query failed: $sql".mysql_error());
and i’ve many like some3 , some4 , some5 ..etc so i can’t repeat or my_words like '%some2%'
many times otherwise it would be hard and the code is so long.
so how can i write shortcut like using arrays or something !
Thanks for help
don’t use OR in your sql statement this time, just loop, as you need to delete all – just do it for each word.