Home Insert into 2 table error
Reply: 0

Insert into 2 table error

user825 Published in May 27, 2018, 3:36 am
    $nis = $_POST['nis'];
$nama = $_POST['nama'];
$kelas = $_POST['kelas'];
$nharian = $_POST['nharian'];
$nharian2 = $_POST['nharian2'];
$nrata = $_POST['nrata'];

This is variable I use for value into 2 table.

include "koneksi.php";
$query1="INSERT INTO siswa (nis, nama, kelas) VALUES('$nis','$nama','$kelas')";
  $query2="INSERT INTO nilai (nis, nharian, nharian2, nrata) VALUES('$nis','$nharian','$nharian2','$nrata')";
mysql_query($query1) or die("Gagal menyimpan data transaksi");
mysql_query($query2) or die("Gagal menyimpan data sub transaksi");

And for this one is for call connection and for insert into 2 table, the table 1 name is siswa and the number 2 table is nilai. When I click submit, mysql says "Gagal menyimpan data transaksi".

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.316511 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO