Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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