Web lists-archives.com

Re: [PHP] Sanity check on arrays ...




On 23/08/15 16:14, Aziz Saleh wrote:
>     $ret = array();
> 
>     while ($res = $result->fetchRow()) {
>     Tidy contents of $res array
>     $ret[] = $res;
>     }
> 
>     What I expect and what is happening on every other lookup is that
>     $ret[0] contains first result array ... on this one there is another
>     level being added so $ret[][0] and the following code sees an empty
>     array for this data set :(
> 
>     Can't see anything different to the other working loops so anybody got
>     an idea where the extra level materialised from?

> echo '<pre>'; print_r($ret);
> 
> What do you get for that. From what I can see you should be getting
> something like:
> 
> $ret = array (
>     array('id' => 1, 'name' => 'test1'),
>     array('id' => 2, 'name' => 'test2'),
> );

Was using vd() to inspect the array and convincing myself that the array
was at fault, but eventually track problem down to an old version of a
file which has the V2 smarty code in rather than V3 ... NOW I've got a
list of blogs showing as well ...

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php