I am wanting to do an array for the same user where multiple form data for the same item would be entered into the same table in MySQL.
Page 1
<form method="post" action="order-check-out.php">
<div>Country</div><div><input type="text" name="ef_country[]"></div>
<div>State</div><div><input type="text" name="ef_state[]"></div>
<div>City</div><div><input type="text" name="ef_city[]"></div>
<div>Country</div><div><input type="text" name="ef_country[]"></div>
<div>State</div><div><input type="text" name="ef_state[]"></div>
<div>City</div><div><input type="text" name="ef_city[]"></div>
<input type="submit" value="Order Services">
And the above could be more than 10 inserts.
Check Out page
$_SESSION['ef_country'] = $_POST['ef_country'];
$_SESSION['ef_state'] = $_POST['ef_state'];
$_SESSION['ef_city'] = $_POST['ef_city'];
$db->insert('as_user_addr', array(
"ef_client_id" => $userInfo['user_id'],
"ef_country" => $_SESSION['ef_country'],
"ef_state" => $_SESSION['ef_state'],
"ef_city" => $_SESSION['ef_city'],
));
However, if I have one set of input boxes, the data will insert into MySQL db without any issue. However, I cannot figure out how to do it for multiple form data. Many of the examples found on here seem to echo data, which does not help me. I am needing help with inserting data. I am not sure if it requires a count or loops, etc. I can write PHP the old way, but not this new type of programming.