Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

MySQL – Delete Command

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

freeflow

Established Member
Impact
13
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.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
mysql_query("DELETE FROM guestbook WHERE Text LIKE '%http%'");
 
0
Close
I'd recommend making a database backup first. You never know, you may end up deleting more than you want to ;)
 
0
Close
At least perform a select before the delete... ;)
 
0
Close
You can also add limits to your deletion, such as
Code:
Delete From `table` where `row` LIKE '%Something%' limit 1

What happens if an error comes up and Something = Nothing?
Then it clears your database.
Using Limit # stops it from deleting too many. It also speeds up queries when dealing with large databases.


Bruce
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back