insert into database using dynamic form











up vote
3
down vote

favorite












i`m trying to insert a data into database from a dynamic form, the data is being inserted sucsessfully but only the newest input field will being added to the database (example : i add a new input to the form using the button in the web, the data that being inserted is only the new input, meanwhile the input before the new one doesnt inserted).



<?php 
include 'config/db_connect.php';

if(isset($_POST['submit']))
{
$i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$file = $_POST['file'];
$selectidmax =mysqli_query($con, "SELECT max(id_kebijakan) as maxidadmin FROM t_kebijakan WHERE id_kebijakan LIKE 'KO%'");
$hslidmax=mysqli_fetch_array($selectidmax);
$idmax=$hslidmax['maxidadmin'];
$nourut = (int) substr($idmax, 2,3);
$nourut++;
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


if($query){
header('location: home_cu.php');
}else{
echo "data gagal dimasukan" . mysqli_error($con) . mysqli_errno($con);
}

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Add More Input Form</title>

<!-- Bootstrap -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<?php
include 'config/db_connect.php';
$kode_cu = $_GET['kode_cu'];
$query_mysql = mysqli_query($con,"SELECT * FROM t_cu WHERE kode_cu='$kode_cu'")or die(mysqli_error());
$nomor = 1;
while($data = mysqli_fetch_array($query_mysql)){
?>
<div class="container">
<h1 class="text-center">Tambah Data Kebijakan</h1>
<form action="add_kebijakan.php" method="post">
<h1 class="text-left">File</h1>
<div class="form-content">
<label>File :</label>
<input type="file" name="file">
<input type="hidden" value="<?php echo $data['kode_cu']?>" name="meja" class="form-control"/>
</div>
<h1 class="text-center">Produk Simpanan Saham</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_saham" class="form-control">
</div>
</div>
<?php } ?>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_saham" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_saham" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_saham" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Harian</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_harian" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_harian" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_harian" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_harian" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Berjangka</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_berjangka" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_berjangka" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_berjangka" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Deposito</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_deposito" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_deposito" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_deposito" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_deposito" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Pinjaman</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_pinjaman" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_pinjaman" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<p>
<button type="submit" class="btn btn-success" name="submit">Simpan</button>
</p><br/>
</form>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="assets/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="jquery.multifield.min.js"></script>
<script>
$('.form-content').multifield({
section: '.group',
btnAdd:'#btnAdd',
btnRemove:'.btnRemove',
});
</script>
</body>
</html>


this is the result after i added echo "<pre>";print_r($_POST['kp_saham']);



Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => AD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(




[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => CO001
)


note : the ASD, ADS is just word that type randomly










share|improve this question




















  • 1




    Please reduce your code to the minimum we need to solve your problem
    – Lithilion
    Nov 12 at 7:29






  • 1




    Danger: You are vulnerable to SQL injection attacks that you need to defend yourself from.
    – Quentin
    Nov 12 at 7:50















up vote
3
down vote

favorite












i`m trying to insert a data into database from a dynamic form, the data is being inserted sucsessfully but only the newest input field will being added to the database (example : i add a new input to the form using the button in the web, the data that being inserted is only the new input, meanwhile the input before the new one doesnt inserted).



<?php 
include 'config/db_connect.php';

if(isset($_POST['submit']))
{
$i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$file = $_POST['file'];
$selectidmax =mysqli_query($con, "SELECT max(id_kebijakan) as maxidadmin FROM t_kebijakan WHERE id_kebijakan LIKE 'KO%'");
$hslidmax=mysqli_fetch_array($selectidmax);
$idmax=$hslidmax['maxidadmin'];
$nourut = (int) substr($idmax, 2,3);
$nourut++;
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


if($query){
header('location: home_cu.php');
}else{
echo "data gagal dimasukan" . mysqli_error($con) . mysqli_errno($con);
}

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Add More Input Form</title>

<!-- Bootstrap -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<?php
include 'config/db_connect.php';
$kode_cu = $_GET['kode_cu'];
$query_mysql = mysqli_query($con,"SELECT * FROM t_cu WHERE kode_cu='$kode_cu'")or die(mysqli_error());
$nomor = 1;
while($data = mysqli_fetch_array($query_mysql)){
?>
<div class="container">
<h1 class="text-center">Tambah Data Kebijakan</h1>
<form action="add_kebijakan.php" method="post">
<h1 class="text-left">File</h1>
<div class="form-content">
<label>File :</label>
<input type="file" name="file">
<input type="hidden" value="<?php echo $data['kode_cu']?>" name="meja" class="form-control"/>
</div>
<h1 class="text-center">Produk Simpanan Saham</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_saham" class="form-control">
</div>
</div>
<?php } ?>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_saham" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_saham" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_saham" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Harian</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_harian" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_harian" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_harian" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_harian" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Berjangka</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_berjangka" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_berjangka" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_berjangka" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Deposito</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_deposito" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_deposito" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_deposito" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_deposito" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Pinjaman</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_pinjaman" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_pinjaman" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<p>
<button type="submit" class="btn btn-success" name="submit">Simpan</button>
</p><br/>
</form>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="assets/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="jquery.multifield.min.js"></script>
<script>
$('.form-content').multifield({
section: '.group',
btnAdd:'#btnAdd',
btnRemove:'.btnRemove',
});
</script>
</body>
</html>


this is the result after i added echo "<pre>";print_r($_POST['kp_saham']);



Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => AD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(




[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => CO001
)


note : the ASD, ADS is just word that type randomly










share|improve this question




















  • 1




    Please reduce your code to the minimum we need to solve your problem
    – Lithilion
    Nov 12 at 7:29






  • 1




    Danger: You are vulnerable to SQL injection attacks that you need to defend yourself from.
    – Quentin
    Nov 12 at 7:50













up vote
3
down vote

favorite









up vote
3
down vote

favorite











i`m trying to insert a data into database from a dynamic form, the data is being inserted sucsessfully but only the newest input field will being added to the database (example : i add a new input to the form using the button in the web, the data that being inserted is only the new input, meanwhile the input before the new one doesnt inserted).



<?php 
include 'config/db_connect.php';

if(isset($_POST['submit']))
{
$i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$file = $_POST['file'];
$selectidmax =mysqli_query($con, "SELECT max(id_kebijakan) as maxidadmin FROM t_kebijakan WHERE id_kebijakan LIKE 'KO%'");
$hslidmax=mysqli_fetch_array($selectidmax);
$idmax=$hslidmax['maxidadmin'];
$nourut = (int) substr($idmax, 2,3);
$nourut++;
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


if($query){
header('location: home_cu.php');
}else{
echo "data gagal dimasukan" . mysqli_error($con) . mysqli_errno($con);
}

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Add More Input Form</title>

<!-- Bootstrap -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<?php
include 'config/db_connect.php';
$kode_cu = $_GET['kode_cu'];
$query_mysql = mysqli_query($con,"SELECT * FROM t_cu WHERE kode_cu='$kode_cu'")or die(mysqli_error());
$nomor = 1;
while($data = mysqli_fetch_array($query_mysql)){
?>
<div class="container">
<h1 class="text-center">Tambah Data Kebijakan</h1>
<form action="add_kebijakan.php" method="post">
<h1 class="text-left">File</h1>
<div class="form-content">
<label>File :</label>
<input type="file" name="file">
<input type="hidden" value="<?php echo $data['kode_cu']?>" name="meja" class="form-control"/>
</div>
<h1 class="text-center">Produk Simpanan Saham</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_saham" class="form-control">
</div>
</div>
<?php } ?>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_saham" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_saham" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_saham" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Harian</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_harian" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_harian" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_harian" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_harian" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Berjangka</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_berjangka" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_berjangka" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_berjangka" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Deposito</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_deposito" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_deposito" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_deposito" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_deposito" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Pinjaman</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_pinjaman" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_pinjaman" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<p>
<button type="submit" class="btn btn-success" name="submit">Simpan</button>
</p><br/>
</form>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="assets/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="jquery.multifield.min.js"></script>
<script>
$('.form-content').multifield({
section: '.group',
btnAdd:'#btnAdd',
btnRemove:'.btnRemove',
});
</script>
</body>
</html>


this is the result after i added echo "<pre>";print_r($_POST['kp_saham']);



Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => AD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(




[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => CO001
)


note : the ASD, ADS is just word that type randomly










share|improve this question















i`m trying to insert a data into database from a dynamic form, the data is being inserted sucsessfully but only the newest input field will being added to the database (example : i add a new input to the form using the button in the web, the data that being inserted is only the new input, meanwhile the input before the new one doesnt inserted).



<?php 
include 'config/db_connect.php';

if(isset($_POST['submit']))
{
$i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$file = $_POST['file'];
$selectidmax =mysqli_query($con, "SELECT max(id_kebijakan) as maxidadmin FROM t_kebijakan WHERE id_kebijakan LIKE 'KO%'");
$hslidmax=mysqli_fetch_array($selectidmax);
$idmax=$hslidmax['maxidadmin'];
$nourut = (int) substr($idmax, 2,3);
$nourut++;
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


if($query){
header('location: home_cu.php');
}else{
echo "data gagal dimasukan" . mysqli_error($con) . mysqli_errno($con);
}

}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Add More Input Form</title>

<!-- Bootstrap -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<?php
include 'config/db_connect.php';
$kode_cu = $_GET['kode_cu'];
$query_mysql = mysqli_query($con,"SELECT * FROM t_cu WHERE kode_cu='$kode_cu'")or die(mysqli_error());
$nomor = 1;
while($data = mysqli_fetch_array($query_mysql)){
?>
<div class="container">
<h1 class="text-center">Tambah Data Kebijakan</h1>
<form action="add_kebijakan.php" method="post">
<h1 class="text-left">File</h1>
<div class="form-content">
<label>File :</label>
<input type="file" name="file">
<input type="hidden" value="<?php echo $data['kode_cu']?>" name="meja" class="form-control"/>
</div>
<h1 class="text-center">Produk Simpanan Saham</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_saham" class="form-control">
</div>
</div>
<?php } ?>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_saham" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_saham" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_saham" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Harian</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_harian" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_harian" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_harian" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_harian" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Berjangka</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_berjangka" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_berjangka" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_berjangka" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Simpanan Deposito</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_deposito" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_deposito" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_deposito" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_deposito" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<h1 class="text-center">Produk Pinjaman</h1>
<div class="form-content">
<div class="row">
<div class="col-md-12">
<p><button type="button" id="btnAdd" class="btn btn-primary">Add More</button></p>
<br/>
</div>
</div>
<div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_pinjaman" class="form-control"/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Produk</label>
<input type="text" name="produk_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Bunga</label>
<input type="text" name="bunga_pinjaman" class="form-control">
</div>
</div>
<div class="col-md-5">
<div class="form-group">
<label>Keterangan</label>
<textarea name="ket_pinjaman" class="form-control" rows="3"></textarea>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" class="btn btn-danger btnRemove">Remove</button>
</div>
</div>
</div>
</div>
<p>
<button type="submit" class="btn btn-success" name="submit">Simpan</button>
</p><br/>
</form>
</div>

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="assets/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="jquery.multifield.min.js"></script>
<script>
$('.form-content').multifield({
section: '.group',
btnAdd:'#btnAdd',
btnRemove:'.btnRemove',
});
</script>
</body>
</html>


this is the result after i added echo "<pre>";print_r($_POST['kp_saham']);



Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ADS
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => AD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(




[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => ASD
)
Array
(
[0] => CO001
)


note : the ASD, ADS is just word that type randomly







php






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 8:51

























asked Nov 12 at 7:19









InFocus

106




106








  • 1




    Please reduce your code to the minimum we need to solve your problem
    – Lithilion
    Nov 12 at 7:29






  • 1




    Danger: You are vulnerable to SQL injection attacks that you need to defend yourself from.
    – Quentin
    Nov 12 at 7:50














  • 1




    Please reduce your code to the minimum we need to solve your problem
    – Lithilion
    Nov 12 at 7:29






  • 1




    Danger: You are vulnerable to SQL injection attacks that you need to defend yourself from.
    – Quentin
    Nov 12 at 7:50








1




1




Please reduce your code to the minimum we need to solve your problem
– Lithilion
Nov 12 at 7:29




Please reduce your code to the minimum we need to solve your problem
– Lithilion
Nov 12 at 7:29




1




1




Danger: You are vulnerable to SQL injection attacks that you need to defend yourself from.
– Quentin
Nov 12 at 7:50




Danger: You are vulnerable to SQL injection attacks that you need to defend yourself from.
– Quentin
Nov 12 at 7:50












2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










As per my understanding you have used jquery multifield js to generate certain form fields multiple time. To save multiple records you have to do following steps.



1.Create array of controls by adding in the name of input control i.e.



<input type="text" name="kp_berjangka" class="form-control"/>


This need to be done with all input fields which need to be stored in database



2.While processing post request you need to save data using loop. Code will be similar like this.
i.e.



 $i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


By using this loop you will get all record submitted by forms.



3.You can not save file using $_POST['FILE'] please check file uploading process from https://www.w3schools.com/php/php_file_upload.asp This will help you






share|improve this answer























  • ok, and where do i put the queries?
    – InFocus
    Nov 12 at 8:19










  • @InFocus i have updated my answer
    – Manish Shukla
    Nov 12 at 8:26










  • your code only inserted the first recored, the record that being added from the add more button doesn`t inserted into the database, i will update my question for the updated code
    – InFocus
    Nov 12 at 8:49


















up vote
2
down vote













In this part or the others try to add in the name of input. example



                <div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>


then in your form action do this



echo "<pre>";print_r($_POST['kp_saham']);





share|improve this answer























  • echo "<pre>";print_r($kp_berjangka); do you mean replacing $kp_saham = $_POST['kp_saham']; with that?
    – InFocus
    Nov 12 at 7:41










  • for now don't replace it. Just add die() below my script. and try check the input.
    – MyNameIs
    Nov 12 at 7:43










  • and if i replace it with 'echo "<pre>";print_r($_POST['kp_saham']);' , what should i put in the values inside the query?
    – InFocus
    Nov 12 at 7:43










  • i just want to see the value(s) for now.
    – MyNameIs
    Nov 12 at 7:44












  • i edited it, check it
    – InFocus
    Nov 12 at 7:53











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257453%2finsert-into-database-using-dynamic-form%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










As per my understanding you have used jquery multifield js to generate certain form fields multiple time. To save multiple records you have to do following steps.



1.Create array of controls by adding in the name of input control i.e.



<input type="text" name="kp_berjangka" class="form-control"/>


This need to be done with all input fields which need to be stored in database



2.While processing post request you need to save data using loop. Code will be similar like this.
i.e.



 $i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


By using this loop you will get all record submitted by forms.



3.You can not save file using $_POST['FILE'] please check file uploading process from https://www.w3schools.com/php/php_file_upload.asp This will help you






share|improve this answer























  • ok, and where do i put the queries?
    – InFocus
    Nov 12 at 8:19










  • @InFocus i have updated my answer
    – Manish Shukla
    Nov 12 at 8:26










  • your code only inserted the first recored, the record that being added from the add more button doesn`t inserted into the database, i will update my question for the updated code
    – InFocus
    Nov 12 at 8:49















up vote
1
down vote



accepted










As per my understanding you have used jquery multifield js to generate certain form fields multiple time. To save multiple records you have to do following steps.



1.Create array of controls by adding in the name of input control i.e.



<input type="text" name="kp_berjangka" class="form-control"/>


This need to be done with all input fields which need to be stored in database



2.While processing post request you need to save data using loop. Code will be similar like this.
i.e.



 $i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


By using this loop you will get all record submitted by forms.



3.You can not save file using $_POST['FILE'] please check file uploading process from https://www.w3schools.com/php/php_file_upload.asp This will help you






share|improve this answer























  • ok, and where do i put the queries?
    – InFocus
    Nov 12 at 8:19










  • @InFocus i have updated my answer
    – Manish Shukla
    Nov 12 at 8:26










  • your code only inserted the first recored, the record that being added from the add more button doesn`t inserted into the database, i will update my question for the updated code
    – InFocus
    Nov 12 at 8:49













up vote
1
down vote



accepted







up vote
1
down vote



accepted






As per my understanding you have used jquery multifield js to generate certain form fields multiple time. To save multiple records you have to do following steps.



1.Create array of controls by adding in the name of input control i.e.



<input type="text" name="kp_berjangka" class="form-control"/>


This need to be done with all input fields which need to be stored in database



2.While processing post request you need to save data using loop. Code will be similar like this.
i.e.



 $i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


By using this loop you will get all record submitted by forms.



3.You can not save file using $_POST['FILE'] please check file uploading process from https://www.w3schools.com/php/php_file_upload.asp This will help you






share|improve this answer














As per my understanding you have used jquery multifield js to generate certain form fields multiple time. To save multiple records you have to do following steps.



1.Create array of controls by adding in the name of input control i.e.



<input type="text" name="kp_berjangka" class="form-control"/>


This need to be done with all input fields which need to be stored in database



2.While processing post request you need to save data using loop. Code will be similar like this.
i.e.



 $i=0;
foreach($_POST['kp_berjangka'] as $value){
// insert query values can be fetched by
$IDbaru = "KO" . sprintf("%03s", $nourut);
$kp_saham = $_POST['kp_saham'][$i];
$pro_saham = $_POST['produk_saham'][$i];
$bung_saham = $_POST['bunga_saham'][$i];
$ket_saham = $_POST['ket_saham'][$i];
$kp_harian = $_POST['kp_harian'][$i];
$pro_harian = $_POST['produk_harian'][$i];
$bung_harian = $_POST['bunga_harian'][$i];
$ket_harian = $_POST['ket_harian'][$i];
$kp_berjangka = $_POST['kp_berjangka'][$i];
$pro_berjangka = $_POST['produk_berjangka'][$i];
$bung_berjangka = $_POST['bunga_berjangka'][$i];
$ket_berjangka = $_POST['ket_berjangka'][$i];
$kp_deposito = $_POST['kp_deposito'][$i];
$pro_deposito = $_POST['produk_deposito'][$i];
$bung_deposito = $_POST['bunga_deposito'][$i];
$ket_deposito = $_POST['ket_deposito'][$i];
$kp_pinjaman = $_POST['kp_pinjaman'][$i];
$pro_pinjaman = $_POST['produk_pinjaman'][$i];
$bung_pinjaman = $_POST['bunga_pinjaman'][$i];
$ket_pinjaman = $_POST['ket_pinjaman'][$i];
$id = $_POST['meja'][$i];

$query = mysqli_query($con,"INSERT INTO t_kebijakan (id_kebijakan, file, kp_saham, produk_saham, bunga_saham, keterangan_saham, kp_harian, produk_harian, bunga_harian, keterangan_harian, kp_berjangka, produk_berjangka, bunga_berjangka, keterangan_berjangka, kp_deposito, produk_deposito, bunga_deposito, keterangan_deposito, kp_pinjaman, produk_pinjaman, bunga_pinjaman, keterangan_pinjaman, kode_cu)
VALUES (
'$IDbaru',
'$file',
'$kp_saham',
'$pro_saham',
'$bung_saham',
'$ket_saham',
'$kp_harian',
'$pro_harian',
'$bung_harian',
'$ket_harian',
'$kp_berjangka',
'$pro_berjangka',
'$bung_berjangka',
'$ket_berjangka',
'$kp_deposito',
'$pro_deposito',
'$bung_deposito',
'$ket_deposito',
'$kp_pinjaman',
'$pro_pinjaman',
'$bung_pinjaman',
'$ket_pinjaman',
'$id'
)");
}


By using this loop you will get all record submitted by forms.



3.You can not save file using $_POST['FILE'] please check file uploading process from https://www.w3schools.com/php/php_file_upload.asp This will help you







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 at 8:32









octano

208415




208415










answered Nov 12 at 8:15









Manish Shukla

1,0972720




1,0972720












  • ok, and where do i put the queries?
    – InFocus
    Nov 12 at 8:19










  • @InFocus i have updated my answer
    – Manish Shukla
    Nov 12 at 8:26










  • your code only inserted the first recored, the record that being added from the add more button doesn`t inserted into the database, i will update my question for the updated code
    – InFocus
    Nov 12 at 8:49


















  • ok, and where do i put the queries?
    – InFocus
    Nov 12 at 8:19










  • @InFocus i have updated my answer
    – Manish Shukla
    Nov 12 at 8:26










  • your code only inserted the first recored, the record that being added from the add more button doesn`t inserted into the database, i will update my question for the updated code
    – InFocus
    Nov 12 at 8:49
















ok, and where do i put the queries?
– InFocus
Nov 12 at 8:19




ok, and where do i put the queries?
– InFocus
Nov 12 at 8:19












@InFocus i have updated my answer
– Manish Shukla
Nov 12 at 8:26




@InFocus i have updated my answer
– Manish Shukla
Nov 12 at 8:26












your code only inserted the first recored, the record that being added from the add more button doesn`t inserted into the database, i will update my question for the updated code
– InFocus
Nov 12 at 8:49




your code only inserted the first recored, the record that being added from the add more button doesn`t inserted into the database, i will update my question for the updated code
– InFocus
Nov 12 at 8:49












up vote
2
down vote













In this part or the others try to add in the name of input. example



                <div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>


then in your form action do this



echo "<pre>";print_r($_POST['kp_saham']);





share|improve this answer























  • echo "<pre>";print_r($kp_berjangka); do you mean replacing $kp_saham = $_POST['kp_saham']; with that?
    – InFocus
    Nov 12 at 7:41










  • for now don't replace it. Just add die() below my script. and try check the input.
    – MyNameIs
    Nov 12 at 7:43










  • and if i replace it with 'echo "<pre>";print_r($_POST['kp_saham']);' , what should i put in the values inside the query?
    – InFocus
    Nov 12 at 7:43










  • i just want to see the value(s) for now.
    – MyNameIs
    Nov 12 at 7:44












  • i edited it, check it
    – InFocus
    Nov 12 at 7:53















up vote
2
down vote













In this part or the others try to add in the name of input. example



                <div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>


then in your form action do this



echo "<pre>";print_r($_POST['kp_saham']);





share|improve this answer























  • echo "<pre>";print_r($kp_berjangka); do you mean replacing $kp_saham = $_POST['kp_saham']; with that?
    – InFocus
    Nov 12 at 7:41










  • for now don't replace it. Just add die() below my script. and try check the input.
    – MyNameIs
    Nov 12 at 7:43










  • and if i replace it with 'echo "<pre>";print_r($_POST['kp_saham']);' , what should i put in the values inside the query?
    – InFocus
    Nov 12 at 7:43










  • i just want to see the value(s) for now.
    – MyNameIs
    Nov 12 at 7:44












  • i edited it, check it
    – InFocus
    Nov 12 at 7:53













up vote
2
down vote










up vote
2
down vote









In this part or the others try to add in the name of input. example



                <div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>


then in your form action do this



echo "<pre>";print_r($_POST['kp_saham']);





share|improve this answer














In this part or the others try to add in the name of input. example



                <div class="row group">
<div class="col-md-3">
<div class="form-group">
<label>Kode Produk :</label>
<input type="text" name="kp_berjangka" class="form-control"/>
</div>
</div>


then in your form action do this



echo "<pre>";print_r($_POST['kp_saham']);






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 at 7:42

























answered Nov 12 at 7:36









MyNameIs

589




589












  • echo "<pre>";print_r($kp_berjangka); do you mean replacing $kp_saham = $_POST['kp_saham']; with that?
    – InFocus
    Nov 12 at 7:41










  • for now don't replace it. Just add die() below my script. and try check the input.
    – MyNameIs
    Nov 12 at 7:43










  • and if i replace it with 'echo "<pre>";print_r($_POST['kp_saham']);' , what should i put in the values inside the query?
    – InFocus
    Nov 12 at 7:43










  • i just want to see the value(s) for now.
    – MyNameIs
    Nov 12 at 7:44












  • i edited it, check it
    – InFocus
    Nov 12 at 7:53


















  • echo "<pre>";print_r($kp_berjangka); do you mean replacing $kp_saham = $_POST['kp_saham']; with that?
    – InFocus
    Nov 12 at 7:41










  • for now don't replace it. Just add die() below my script. and try check the input.
    – MyNameIs
    Nov 12 at 7:43










  • and if i replace it with 'echo "<pre>";print_r($_POST['kp_saham']);' , what should i put in the values inside the query?
    – InFocus
    Nov 12 at 7:43










  • i just want to see the value(s) for now.
    – MyNameIs
    Nov 12 at 7:44












  • i edited it, check it
    – InFocus
    Nov 12 at 7:53
















echo "<pre>";print_r($kp_berjangka); do you mean replacing $kp_saham = $_POST['kp_saham']; with that?
– InFocus
Nov 12 at 7:41




echo "<pre>";print_r($kp_berjangka); do you mean replacing $kp_saham = $_POST['kp_saham']; with that?
– InFocus
Nov 12 at 7:41












for now don't replace it. Just add die() below my script. and try check the input.
– MyNameIs
Nov 12 at 7:43




for now don't replace it. Just add die() below my script. and try check the input.
– MyNameIs
Nov 12 at 7:43












and if i replace it with 'echo "<pre>";print_r($_POST['kp_saham']);' , what should i put in the values inside the query?
– InFocus
Nov 12 at 7:43




and if i replace it with 'echo "<pre>";print_r($_POST['kp_saham']);' , what should i put in the values inside the query?
– InFocus
Nov 12 at 7:43












i just want to see the value(s) for now.
– MyNameIs
Nov 12 at 7:44






i just want to see the value(s) for now.
– MyNameIs
Nov 12 at 7:44














i edited it, check it
– InFocus
Nov 12 at 7:53




i edited it, check it
– InFocus
Nov 12 at 7:53


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257453%2finsert-into-database-using-dynamic-form%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine