I have a MySQL and PHP script to enter a row when it doesn't exist.
INSERT INTO `tblPlayerAchievements` (HS_ID, AchievementID, AchievementProgress)
SELECT * FROM (SELECT ".$userData['HS_ID'].", ".$achievementID.", 0) AS tmp
WHERE NOT EXISTS (SELECT * FROM `tblPlayerAchievements`
WHERE HS_ID=".$userData['HS_ID']." AND AchievementID=".$achievementID.")
LIMIT 1
This works perfectly until both $userData['HS_ID'] and $achievementID are the same value and then it skips that one. How do I fix this?