I am trying to get a list to only display user missions that are not already done, I have a table that is setup to collect completed user missions. However I can only get it to not display only either the first one or the last one in the results for selecting the Missions ID from the User Missions Completed table.
I have tried using sub queries to no avail, have tried using different reductions and loops to collect the ID's into an array
$db->query("SELECT mID FROM user_missions_complete WHERE userid = ?");
$db->execute([$user_class->id]);
$get = $db->fetch();
foreach($get as $g) {
$mID = $g['mID'];
}
$db->query("SELECT * FROM `daily_missions` WHERE ID != ? ORDER BY `id` ASC");
$db->execute([$mID]);
$m = $db->fetch();
foreach($m as $mis) {
echo "
<tr>
"; if($mis['task_one'] != 'N/A') { echo "
"; } if($mis['task_two'] != 'N/A') { echo "
"; } if($mis['task_three'] != 'N/A') { echo "
"; } if($mis['task_four'] != 'N/A') { echo "
"; } if($mis['task_five'] != 'N/A') { echo "
"; } if($mis['task_six'] != 'N/A') { echo "
"; } if($mis['task_seven'] != 'N/A') { echo "
"; } if($mis['task_eight'] != 'N/A') { echo "
"; } echo "
</tr>";
}
What I am trying to accomplish is for the list of missions from daily_missions to only show on the page results/missions that are not already completed and inside the user_missions_complete table. However, it is only either not including the first result or the last result in the query results.