How do I avoid duplicate records insertion in PHP MYSQLi? this my script :
$nama=$_POST['nama'];
$member=$_POST['member'];
$peserta=$_POST['peserta'];
$tour=$_POST['tour'];
mysqli_query($conn,"insert into gathering (nama, member, peserta, tour) values ('$nama', '$member', '$peserta', '$tour')");
header('location:index.php');
Below code will help you inserting unique data:
1.You can alter table with Unique constraint :
get record from table before insert record and check whether record is already exist or not.
tambahkan kolom dengan primary key
first check if the row exists and then insert