| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Dec 2006
Posts: 236
![]() | MySQL – Delete Command I am looking for the right command to delete all entries in my guestbook that have a HTTP in them. Can you correct this command? mysql_query("DELETE FROM guestbook WHERE Text='%http%'"); ![]() Thanks. |
| |
| | #4 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,552
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | At least perform a select before the delete...
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | #5 (permalink) |
| NamePros Member Join Date: Sep 2006
Posts: 99
![]() ![]() | You can also add limits to your deletion, such as Code: Delete From `table` where `row` LIKE '%Something%' limit 1 Then it clears your database. Using Limit # stops it from deleting too many. It also speeds up queries when dealing with large databases. Bruce |
| |