Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am running a gameserver, i have 2 entries i am trying to delete.

The game logs player user id's in 2 seperate tables:

1) player_login
2) character_data

character_data has lastlogin and playeruid information i want a query that deletes the entry from player_login and character_data if the lastlogin was longer than a week i have this at the moment but im not sure if its correct and if i changed it to delete i believe it would only delete from character_data

SELECT count(*) FROM character_data
WHERE EXISTS
  ( select PlayerUID
    from player_login 
		where (character_data.LastLogin <= NOW() - INTERVAL 7 day)
);
Posted

1 solution

CREATE TRIGGER .... AFTER DELETE on ... etc

So now you only need handle one table and have its trigger handle the other.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900