Re: SESSION array problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 3:41 PM -0400 10/1/08, tedd wrote:
What about:

foreach ($_SESSION['user_id'] as $key => $value)
{
	$last = $_SESSION['last_name'][$key];
	$first = $_SESSION['first_name'][$key];
	echo "$last, $first";
}

Jay:

Close, it produced:

Array, Array
Array, Array
Array, Array

Cheers,

tedd


My error, if produced.


Cable, Diane
a, i

While print_r($_SESSION); JUST BEFORE IT produced:

[user_id] => Array
	(
		[0] => 6156
		[1] => 7030
		[2] => 656
	)

[first_name] => Array
	(
		[0] => Diane
		[1] => first name
		[2] => Helen
	)

[last_name] => Array
	(
		[0] => Cable
		[1] => CagoEsogs-temp (forum)
		[2] => Cahalane
	)

Now, what wrong with this picture?

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux