|
-
May 8th, 2002, 03:17 AM
#1
Thread Starter
Hyperactive Member
delete record (MySql)
How can I delete record that it's ID=8 ????
-
May 8th, 2002, 06:11 AM
#2
Addicted Member
DELETE * FROM tableName WHERE ID = 8;
-
May 8th, 2002, 08:52 AM
#3
PowerPoster
you don't need to put the * in according to the docs, that is just for compatibilty with Access apparently
-
May 8th, 2002, 10:18 AM
#4
Addicted Member
wow, I didn't know that. So
DELETE FROM tbl WHERE ID = '$x'
will work fine by itself. Is that so with multi-table deletes?
DELETE tblOne.*, tblTwo.* WHERE tblOne.ID = tblTwo.one_ID
-
May 8th, 2002, 10:25 AM
#5
PowerPoster
yep
The idea is that only matching rows from the tables listed before the FROM or before the USING clause are deleted. The effect is that you can delete rows from many tables at the same time and also have additional tables that are used for searching.
The .* after the table names is there just to be compatible with Access:
DELETE t1,t2 FROM t1,t2,t3 WHERE t1.id=t2.id AND t2.id=t3.id
or
DELETE FROM t1,t2 USING t1,t2,t3 WHERE t1.id=t2.id AND t2.id=t3.id
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|