I have a PHP array that gets the field names and the field values from one of my contact forms.
Here is the array:
foreach ($_POST as $key => $value)
{
if (!is_array($value))
{
$data .= “\n \n”.$key." : “.$value;
}
else
{
foreach ($_POST[$key] as $itemvalue)
{
$data .= “\n \n”.$key.” : ".$itemvalue;
}
}
}
Now I need to break out the VALUES to put into my SQL database. I
I am using MySQL for the database and I am not using all the values in the array to post to the database which is adding (at least for me a php noobie) some complexity to the problem. Obviously the id field id field is my index and is not in the array.
My Database table structure is like this:
id,
name,
address,
city,
state,
zip,
phone,
email,
arrivaldate,
depratdate,
room,
foundus,
promocode,
comments,
date,
ip
Just how How would I about this?
Thank you in advance
Dave