I have arrays within an array and I want to loop through each item of the nested arrays and put them into different mysql columns. There is a limit of 3 entries per array, and I need $workexp_array_t to go into the work experience column, the $credentials_array_t items to go into the credentials column etc.
The problem I'm having is that using these nested foreach loops it just places the first letter of the entry into the column instead of the proper entry. How can I get each array items to go into their proper column? Do I really need to set up separate tables for each thing (ie. education experience, credentials, work experience, etc.)?
$tutor_background = array($workexp_array_t, $credentials_array_t, $education_array_t, $extra_array_t);
foreach ($tutor_background as $entry) {
foreach ($entry as $background) {
$query = "INSERT INTO tutor_background (login_value, work_history, credentials, education_history, extra_skills) VALUES ('{$_SESSION['login_value']}', '{$background[0]}', '{$background[1]}', '{$background[2]}', '{$background[3]}')";
$process_query = mysql_query($query);
}
}