15.06.2015, 12:47
Hey,
I have two questions:
1)
I have already got a table for saving achievements. It contains: accountid & achievementid
Currently i think that some accounts (in the account table) do not exist but their id's does in the achievement table (since i already had to remove some rows from the account table).
How shall i check for these ids in the achievement table that do not have an alternative in the account's table (same ID)?
And
Keep both connected? As if i did delete an account from the account's table, it should automatically drop the row from the achievements table.
Note: Both tables are linked by the id of the account (AUTO_INCREMENT).
2)
I'm creating a new table that has additional info (ex, mutetime and jailtime), i insert a row once the player gets muted or get jailed, and then drop the row once the mutetime ends and the jailtime is 0.
Lets consider:
The player is not jailed nor muted. He gets muted, a new row is inserted: Jailtime = 0, MuteTime = 10. And then he gets jailed, the statement is itself "Insert" but the row already exists, how shall this be done (update a row if it exists and create a new one if its not)?
I have two questions:
1)
I have already got a table for saving achievements. It contains: accountid & achievementid
Currently i think that some accounts (in the account table) do not exist but their id's does in the achievement table (since i already had to remove some rows from the account table).
How shall i check for these ids in the achievement table that do not have an alternative in the account's table (same ID)?
And
Keep both connected? As if i did delete an account from the account's table, it should automatically drop the row from the achievements table.
Note: Both tables are linked by the id of the account (AUTO_INCREMENT).
2)
I'm creating a new table that has additional info (ex, mutetime and jailtime), i insert a row once the player gets muted or get jailed, and then drop the row once the mutetime ends and the jailtime is 0.
Lets consider:
The player is not jailed nor muted. He gets muted, a new row is inserted: Jailtime = 0, MuteTime = 10. And then he gets jailed, the statement is itself "Insert" but the row already exists, how shall this be done (update a row if it exists and create a new one if its not)?

