accessing arrays within arrays

From: Date: Wed, 26 May 2004 13:18:44 +0000
Subject: accessing arrays within arrays
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11410@lists.php.net to get a copy of this message
I'm having problems accessing an associative array within another array which is part of an object. I think code is clearer here: {section name=records loop=$search->records} {* The following works, if the query generating $search->records is an indexed array *} {$search->records[records][0]} {* However, the following returns an 'undefined index' error when the query returns an associative array *} {$search->records[records][name]} {/section} $search is an object; records is an array containing result rows, each of which is an array. I'm not sure if I'm making a syntax mistake, or trying to do something which isn't possible - any help much appreciated! Thanks, Benjamin

« previous php.smarty.general (#11410) next »