newbreed65 Posted February 14, 2009 Share Posted February 14, 2009 Hi Everyone I'm currently trying to figure out how to deal with more than one array since this is the first time Ive tried doing something like this. below is some code that in the end with be changed into a Update MySQL query case "Save": $test = $_POST['character']; $test2 = $_POST['castid']; foreach ($test as $key=> $person){ echo $person . " "; foreach ($test2 as $key=> $id){ echo $id . " "; echo "<br>"; } } break; What i want the code to do is display the data from the arrays like this.. Rachel Dawes 13 Det. Anna Ramirez 14 Lucas Fox 2 but currently in this version of the code it getting displayed like this .. Rachel Dawes 13 14 2 Det. Anna Ramirez 13 14 2 Lucas Fox 13 14 2 Any ideas?? i got a feeling like i might be about this completely wrong Quote Link to comment https://forums.phpfreaks.com/topic/145203-solved-problem-dealing-with-multiply-arrays/ Share on other sites More sharing options...
.josh Posted February 14, 2009 Share Posted February 14, 2009 foreach ($test as $key=> $person){ echo $person . " "; echo $test2[$key] . " "; echo "<br>"; } Quote Link to comment https://forums.phpfreaks.com/topic/145203-solved-problem-dealing-with-multiply-arrays/#findComment-762157 Share on other sites More sharing options...
newbreed65 Posted February 14, 2009 Author Share Posted February 14, 2009 thank you crayon!!! Quote Link to comment https://forums.phpfreaks.com/topic/145203-solved-problem-dealing-with-multiply-arrays/#findComment-762159 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.