Jump to content

Deleting Something Out Of Mysql


littlkj5

Recommended Posts

Delete DB entries the same way you add them, but with a correspondingly different entry.  Instead of querying the database with an INSERT command, query it with a DELETE.  Check out the manual on mysql queries, the documentation is very complete.

Also check out the php reference on the commands mysql_query, as well as the many other embedded mysql php functions.
Link to comment
Share on other sites

If your deleting just 1 item from a database, even though there may be only 1 instance of it in the database I would still suggest using LIMIT 1 a the end of the query.

[code]
DELETE FROM myTable WHERE id = '4' LIMIT 1;
[/code]
Link to comment
Share on other sites

The only way of deleting something is the way SharkBait says,

This code below is deleting 1 thing...
[code]DELETE FROM Table WHERE id='1'[/code]

This is to delete everything...
[code]TRUNCATE Table[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.