草庐IT

php - 如何避免在 php mysqli 中插入重复记录?

这个问题在这里已经有了答案:Howtopreventduplicateusernameswhenpeopleregister?(4个答案)关闭去年。如何避免在PHPMYSQLi中插入重复记录?这是我的脚本:$nama=$_POST['nama'];$member=$_POST['member'];$peserta=$_POST['peserta'];$tour=$_POST['tour'];mysqli_query($conn,"insertintogathering(nama,member,peserta,tour)values('$nama','$member','$peserta