here's my code
$sql=mysql_query("insert into guest (fname, lname, address, contactno, emailadd) values ('$fname', '$lname', '$country', '$contact', '$mail')");
$search = mysql_query("select * from guest order by code DESC limit 1");
$row = mysql_fetch_array($search);
$lastnum = $row['code'];
$number = $_POST["Rooms"];
$count = count($number);
for ($i=0; $i<$count; $i++)
{
mysql_query("Insert Into rent (cno, checkin, checkout, noofrooms, roomtype, status, date, username) values ('$lastnum', '$in', '$out', '$room', '$type', 'pending', '$date', 'guest')") or die(mysql_error());
}
?>
i have a problem if i choose 2 Rooms its only insert 1. how can i insert twice or thrice and more. please help