This is my current $_POST
output.
Array
(
[fullname] => John Doe
[email] => [email protected]
[phone] => 123-455-6444
[address] => 23-10 My Address
[zip] => 12345
[fullname_2] => Array
(
[0] => M. Owen
[1] => V. Persie
)
[email_2] => Array
(
[0] => [email protected]
[1] => [email protected]
)
[phone_2] => Array
(
[0] => 123-455-6555
[1] => 222-111-1111
)
[submit] => Submit
)
I want the data above will store to my current database format looks like below.
id | fullname | email | phone | address | zip | uid
----------------------------------------------------------------------------------------
1 | John Doe | [email protected] | 123-455-6444 | 23-10 My Address | 12345 | 1
2 | M. Owen | [email protected] | | | | 1
3 | V. Persie | [email protected] | | | | 1
I'm getting blur how to save the array to MySQL.
$query = "INSERT INTO users SET fullname ='" . $fullname . "', email ='" . $email . "', phone='" . $phone . "', address ='" . $address . "', zip='" . $zip . "'";
$db->rq($query);
Let me know the clue.