Jump to content

Deleting stuff


Danny620

Recommended Posts

Hi, Sorry to bother you all like this but I really good do with some help.

 

My problem is I have 3 tables users, case_ref & updates all realated to each other by a user_id - I want to be able to delete from all tables if the users account is deleted.

So if a user is deleted so is all the associated data too.

 

delete from users, case_ref, updates where user_id = 1

 

I would be extremely great full if you could help me out on this one.

Link to comment
https://forums.phpfreaks.com/topic/221803-deleting-stuff/
Share on other sites

ive add to do 3

 

// Make the query:
	$q = "DELETE FROM case_ref WHERE user_id='$id'";		
	$r = $r = mysqli_query ($dbc, $q);

	// Make the query:
	$q = "DELETE FROM case_ref WHERE user_id='$id'";		
	$r = $r = mysqli_query ($dbc, $q);

	// Make the query:
	$q = "DELETE FROM users WHERE user_id='$id'";		
	$r = $r = mysqli_query ($dbc, $q);

Link to comment
https://forums.phpfreaks.com/topic/221803-deleting-stuff/#findComment-1147879
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.