O.k. so i was searching around and not very many Guides were on SQL so i decided to make a
VERY basic guide (for those who know this please do not flame me i understand it is somewhat common knowlege.)
O.k. Off we go.
Have you ever wanted to delete an item(s) in your database but don't feel like searching through the mess of ID codes to delete it...
Quote:
|
DELETE FROM 'table_name' WHERE 'category' = 'Item ID'
|
That is a simple Code that allows you to delete one item in your database as long as you know the ID
Here is an example of it finished
Quote:
|
DELETE FROM 'items' WHERE 'entry' = '19385'
|
That is pretty self explaining
Now if you want to delete multiple Items you would put this code in
Quote:
|
DELETE FROM table_name WHERE category IN ('ID1', 'ID2', 'ID3');
|
you can add as many ID's as you want following the same pattern...
A finished example of that would be
Quote:
|
DELETE FROM 'items' WHERE 'entry' IN ('1', '2', '3', '4');
|
Thats about it.....I hope you enjoyed my guide! I also hope it comes in handy.
See Ya!!!