I'm working on a game compatibility database. Here is the submission form.
http://oplinfo.hj.cx/insert.php
I'd like to avoid duplicate entries into the database. Here is my INSERT INTO.
Code:
$sql="INSERT INTO $tbl_name(gamename, gamecode, region, mode, vmc, smb, hdd, usb, notes, comp)VALUES('$gamename', '$gamecode', '$region', '$mode', '$vmc', '$smb', '$hdd', '$usb', '$notes', '$comp')";
When a user makes a submission, the gamecode they submit is already unique (because all manufactured games use a unique game code) and relative only to that entry.
So, if user A submits a game to the database that has the gamecode "ABCD-12345", and user B comes along and tries to supply the same gamecode for their entry, I'd like that submit to fail.
Any tip appreciated!