Game/PHP mySQL

Hi,

I am developing an RPG game in Unity 3D where player stats, quests, items etc are stored on a mySQL database.

Tables:

Players
id
player_name
email_address
password

Quests
id
npc_name
quest_name
quest_text
reward_id
required_items

Player Stats
id
player_id
completed_quests

Code for returning quests to the game


    if(isset($_GET['name'])) {
        $player_id = 1;
        $name = $_GET['name'];
        $query = "SELECT * FROM `Quests` WHERE `npc_name` = '$name'";
        $result = mysql_query($query) or die('Query failed: ' . mysql_error());
    
        $num_results = mysql_num_rows($result); 
    
        for($i = 0; $i < $num_results; $i++)
        {
             $row = mysql_fetch_array($result);
             echo $row['quest_name'] . "*" . $row['quest_text'] . "*" . $row['npc_name']  . "*" . $row['required_items'];
        }
    }

What I would like to do is return quests that the player has not completed. Could someone advise me the best approach.

Thanks

Jason

Would it be best to create another table called completed_quests and hold the players_id, quest_id, date_completed etc. Then when retrieving a quest it could check this table for completed quests by the players_id.

Thanks

Jason