Perintah insert tidak berfungsi

tolong koreksi php saya, link disini


1.     <div id="register">
2. <fieldset>
3. <p><b>SILAHKAN REGISTER DISINI</b>
4. <form name="form1" method="post" action="" enctype="multipart/form-data">
5.   <input name="nobp" type="text" id="nobp" placeholder="Username">
6.     <input name="password" type="text" id="password" placeholder="Password">
7.     <input name="nama" type="text" id="nama" placeholder="Nama Lengkap">
8.     <input name="kelas" type="text" id="kelas" placeholder="No HP">
9.     <input name="simpan" type="submit" id="simpan" value="Simpan Data Mahasiswa">
10. </form>
11. </p>

12. <?php
13. if($_POST['simpan']){
14.   include "koneksi.php";
15.   $jur= substr($_POST["nobp"],7,3);
16.   if (!empty($_POST["nobp"])and !empty($_POST["password"]) and !empty($_POST["nama"])and !empty ($_POST["kelas"])){
17.      if($jur == ""){
18.   
19.   
20.  $sqlm = mysqli_query($kon, "insert into mahasiswa (nobp, password, nama, kelas,tglreg) values ('$_POST[nobp]', '$_POST[password]', '$_POST[nama]', '$_POST[kelas]', NOW())");
21.     
22.   if($sqlm){
23.     echo "Data Mahasiswa Berhasil Disimpan";
24.   }else{
25.     echo "Gagal Menyimpan";
26.   }
27.   echo "<META HTTP-EQUIV='Refresh' Content='1; URL=?p=home'>";

28.   }else{
29.    echo "Anda Bukan Mahasiswa Teknik Informatika";
30.      }
31.   }else{
32.    echo "Data Harus Diisi Lengkap";
33.    }
34.   }
35. ?>
36. </fieldset>
37. </div>

Is this a 000webhost services issue or a coding issue of your own?

1 Like

coding issue, you can help me?

Personally I cannot, but maybe some community users may help you.

You may have better support from dedicated coding sites post it on a few and hopefully you’ll get it resolved.

https://STACKOVERFLOW.COM