I think you will have to make two tables (use normalization of table)
1. car_owner
id (primary key, Auto incr.)
name
email
contact
2. car_registration
id (primary key , Auto incr.)
owner_id (foreign key)
reg_no
<?php
if($_POST['submit'] == "Submit")
{
$name = $_POST['name'];
$email = $_POST['email'];
$contact = $_POST['contact'];
$textbox = $_POST['textfield'];
$query = "insert into car_owner(name,email,contact) values ('".$name."','".$email."','".$contcat."') ";
mysql_query($query);
$last_insert_id = mysql_insert_id();
if(is_array($textbox))
{
foreach($textbox as $textvalue)
{
$textvalue = trim($textvalue);
if($textvalue <> "")
{
$sub_query = "insert into car_registration(owner_id,reg_no) values('".$last_insert_id."','".$textvalue."') ";
mysql_query($sub_query);
}
}
}
}
?>
NOTE :
1. if you have 50 text boxes and user will fill only one text box.
rest of 49 will be wastage of storage.
2. Later if u want to display 55 boxes, then no need to change in code only increase $i<=55.