<?php
 include('connect.php');
$type=$_POST['type'];
$seat=$_POST['seat'];
  $no = $_POST[chkno];//number of checkbox checked
$i=0;
while($i<=$no)
{
$sql2="insert into bookinglist (type,seat) values('$type[i]','$seat[i]')";
$i++;
}
if (!mysql_query($sql2,$con))
  {
  die('Error: ' . mysql_error());
  }

echo "1 record added";


mysql_close($con);
?>

Recommended Answers

All 2 Replies

this code is inserting 1 empty record.please help..

please paste your complete code, including the form

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.