Here, i'am had some case that i thought that are uniq for me. this the problem, i want to looping some tag 3 times. The loop is work, but when it was input to database... just 1 loop that worked.
Here the Screenshot,
<td>
<label for="baris">Baris</label>
<select name="baris">
<option value="">--</option>
<?php
for ($i2=A; $i2 < F; $i2++) {
echo "<option name='".$i2."'>".$i2."</option>";
}
?>
</select>
</td>
<td>
<label for="kolom">Kolom</label>
<select name="kolom">
<?php
for ($i3=1; $i3 <= 10; $i3++) {
echo '<option name="'.$i3.'">'.$i3.'</option>';
}
?>
</select>
</td>
also this code for input to database
<?php
if(isset($_POST['masukan'])){
$nama = htmlspecialchars($_POST['nama']);
$email = htmlspecialchars($_POST['email']);
$jk = htmlspecialchars($_POST['jk']);
$notlp = htmlspecialchars($_POST['notlp']);
$queryinput = mysqli_query($link, "UPDATE tb_customer
SET nama='$nama',
email='$email',
notlp='$notlp',
jk='$jk'
WHERE id_cust='$id_cust1'
");
$querytampil = mysqli_query($link, "SELECT * FROM tb_customer WHERE id_cust ORDER by id_cust desc limit 1");
$dcus = mysqli_fetch_assoc($querytampil);
$id_cust = $dcus['id_cust'];
$querytampil2 = mysqli_query($link, "SELECT max(num_ticket)AS num FROM tb_ticket");
$dnumti = mysqli_fetch_assoc($querytampil2);
$num_ticket = $dnumti['num'];
$hasil = $num_ticket + 1;
for ($i5= 1; $i5 <= $p; $i5++) {
$baris = htmlspecialchars($_POST['baris']);
$kolom = htmlspecialchars($_POST['kolom']);
if($queryinput){
$id_flight = $data['id_flight'];
$queryinput2 = mysqli_query($link, "INSERT INTO tb_ticket VALUES('','$id_cust','$id_flight','$hasil','','','','','$id_dest','$id_ori', '$baris', '$kolom')");
if ($queryinput2) {
$querytampil3 = mysqli_query($link, "SELECT * FROM tb_ticket order by num_ticket desc limit 1");
$dtick = mysqli_fetch_assoc($querytampil3);
$nt = $dtick['num_ticket'];
echo "<script>alert('Succes.')</script>";
echo '<script>window.location="pembayaran.php?num_ticket='.$nt.'&&id_cust='.$id_cust.'"</script>';
}else{
echo "<script>alert('Your data cannot send.')</script>";
}
}else{
echo "<script>alert('Your data cannot send, please check your input data.')</script>";
}
}
}
?>
Bad engslish sorry*