Jump to content
MakeWebGames

How do I delete orphaned data


Guest Anonymous

Recommended Posts

Guest Anonymous

How do I write a query to compare the users database to the inventory, userstats, mail, and forum topics and replies tables and delete all data from userids that have been deleted from the users database? someone help me I have about 2000 IDs that I deleted from my game for inactivity.. but their info remains in the fed the userstats inventory just to name a few.

Link to comment
Share on other sites

Re: How do I delete orphaned data

 

ferdi what do I do if the users table does not have the userid any longer. That is the question.

Well, you could actually make a script that handles this, but to make it a simple query, remove the users table from the query.

Example:

DELETE FROM inventory,forums,mail,events,,userstatus WHERE userid='$id'
Link to comment
Share on other sites

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.   Paste as plain text instead

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