Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.