Jump to content

MySQL MultiTable Delete...


mikey3521

Recommended Posts

Hello, I've been able to delete rows from one table successfully but what I want to try next is giving me some problems. I have a users 'id' which is unique. Heres what I want to-do.

 

DELETE * FROM users WHERE id = 1

DELETE * FROM messages WHERE from = 1

DELETE * FROM comments WHERE user = 1

 

 

In each table there oginizaed a little different hense the id , from & user... but thats what I want to-do, without having to-do them all sepreatly, would like it to be efficent. the users ID will be passed along as the var 'id' any thoughts? So pretty much it takes the users id number and deletes them from each table.

Link to comment
https://forums.phpfreaks.com/topic/55910-mysql-multitable-delete/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.