Jump to content

[SOLVED] Problem dealing with multiply arrays


newbreed65

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.