You've got to call it by $tbl[0]["hardware"]
greetings
    Thomas
--
--
4Ws Netdesign GbR

www.webinside.de...
..wir machen Homepages
--
"Cody Caughlan" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]...
> Hello,
>
> I am implementing an "excel" like webpage, that is multiple boxes like a
> multi-dimensional array. The trick is each row has to have a unique DB
> key.
>
> My problem is this.
>
> ### BEGIN CODE ###
> $rownum = 0;
> while($row = @mysql_fetch_array($res, MYSQL_ASSOC))
> {
>
>       $tbl[$rownum] = $row;
>         $rownum++;
> }
> ### END CODE ###
>
> so if I have a field called "hardware" in my table, I should be able to
> access it by
>
> print "$tbl[0][hardware]";
>
> (assuming that the DB query succeeded in getting some rows.)
>
> When I do this, my print statement outputs
>
> Array[hardware]
>
> But if I was call a print statement like:
>
> print "$row[hardware]";
>
> INSIDE my while loop above, it outputs as expected.
>
> What gives?
>
> Thank you.
> -
> --------------------------
> Cody Caughlan
> [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to