Forum Moderators: coopster
example:
Names of people in Household:
[text field](id=name1)
{link to add new text field}
when link is clicked a second text field is created with id=2 and so on and so on each time link is clicked the id is added +1
now this form submits to mysql database, and i need a php script that will some how create a new field if its not already there to input the id=x so if i have a table
id (primary key auto increment)
fname
lname
phone
blah
blah
blah
name1
it will first check to see if row name2 exists and if it does then great add info, if not create the row and then insert the info.
is this even possible? and if so could someone help me here i have tried so many different ways my head is about to explode!
and insert it there, while customer is the id of the general customer data set you insert into your customer table. that's much cleaner than to dynamically change your database layout.
The input:
$query = "INSERT INTO `table`(`housemembers`)VALUES ("$name1,$name2,$name3,$name4")" ;
To display:
$houselist = "$rows['housemembers']";
$delimiter = ",";
$array = explode($delimiter, $houselist);
foreach ($array as $value) {
echo $value;
}