salman_ahad@yahoo.com Posted November 5, 2009 Share Posted November 5, 2009 I have a link in my rows $bit="http://bit.ly/abcd"; $query = mysql_query("DELETE FROM *table* WHERE sentence........"); //I need to delete all sentence rows which DOES NOT contain my $bit ..pls help Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/ Share on other sites More sharing options...
Mchl Posted November 5, 2009 Share Posted November 5, 2009 DELETE FROM table WHERE sentence NOT LIKE ('%http://bit.ly/abcd%'); Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/#findComment-951841 Share on other sites More sharing options...
salman_ahad@yahoo.com Posted November 5, 2009 Author Share Posted November 5, 2009 by placing '%http://www.bit.ly/abcd%' it will check that link anywhere in the sentence right?? or search for only that link...I need to be able to delete all sentences which does not contain that link.I hope your solution will fix it. Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/#findComment-951894 Share on other sites More sharing options...
salman_ahad@yahoo.com Posted November 5, 2009 Author Share Posted November 5, 2009 It deleted my all 8000 entries in database, any possibility to back that up? Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/#findComment-951926 Share on other sites More sharing options...
mrMarcus Posted November 5, 2009 Share Posted November 5, 2009 It deleted my all 8000 entries in database, any possibility to back that up?serious? you would run a test DELETE command on a full database?? no getting that back, brother. Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/#findComment-951953 Share on other sites More sharing options...
mikesta707 Posted November 5, 2009 Share Posted November 5, 2009 if you didn't back it up before hand, I don't think there is any way to back it up. Well at least you learned to always back your databases up. Do you have any backups at all? Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/#findComment-951963 Share on other sites More sharing options...
Mchl Posted November 5, 2009 Share Posted November 5, 2009 I will only say this: http://www.phpfreaks.com/forums/index.php/topic,275159.msg1300811.html#msg1300811 Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/#findComment-951978 Share on other sites More sharing options...
Daniel0 Posted November 5, 2009 Share Posted November 5, 2009 You might be able to recover it if you still have the binlogs. Don't count on anything though. Quote Link to comment https://forums.phpfreaks.com/topic/180423-delete-rows-based-on-content/#findComment-952049 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.