Page 1 of 1

2 mySQL query codes

Posted: Tue Jun 08, 2004 8:12 am
by bla5e
1) whats the SQL query code to write over data? (example: news page, I have data already submitted into the mySQL db, and now i want to edit or delete that data)

2nd:
whats the SQL query to delete something out of table (yes nub, but i totally forget)

Posted: Tue Jun 08, 2004 8:30 am
by treshr
Use the Update command for the query.

Code: Select all

UPDATE table SET field1 = "test" WHERE id = 1
Hope this helps you.

Posted: Tue Jun 08, 2004 8:43 am
by bla5e
what does "ID = 1" mean?

can someone post a link to explain this query to me.. because the post before this doesnt make any sense.. (or just post the hole query code)

Posted: Tue Jun 08, 2004 8:52 am
by magicrobotmonkey
id could be whatever column name you are using to determine which row you want to overwrite

Posted: Tue Jun 08, 2004 9:07 am
by bla5e
<span style='color:blue' title='I&#39;m naughty, are you naughty?'>smurf</span> i didnt think about that.. grrrr

Posted: Tue Jun 08, 2004 9:16 pm
by evilmonkey

Code: Select all

DELETE FROM table where id = 1
Take a guess what that does. :D

Cheers!