Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
bla5e
Forum Contributor
Posts: 234 Joined: Tue May 25, 2004 4:28 pm
Post
by bla5e » Tue Jun 08, 2004 8:12 am
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)
treshr
Forum Newbie
Posts: 2 Joined: Tue Jun 08, 2004 8:30 am
Post
by treshr » Tue Jun 08, 2004 8:30 am
Use the Update command for the query.
Code: Select all
UPDATE table SET field1 = "test" WHERE id = 1
Hope this helps you.
bla5e
Forum Contributor
Posts: 234 Joined: Tue May 25, 2004 4:28 pm
Post
by bla5e » Tue Jun 08, 2004 8:43 am
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)
magicrobotmonkey
Forum Regular
Posts: 888 Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA
Post
by magicrobotmonkey » Tue Jun 08, 2004 8:52 am
id could be whatever column name you are using to determine which row you want to overwrite
bla5e
Forum Contributor
Posts: 234 Joined: Tue May 25, 2004 4:28 pm
Post
by bla5e » Tue Jun 08, 2004 9:07 am
<span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> i didnt think about that.. grrrr
evilmonkey
Forum Regular
Posts: 823 Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada
Post
by evilmonkey » Tue Jun 08, 2004 9:16 pm
Take a guess what that does.
Cheers!