Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PHP Array Help Please - Seaching Arrays - Array Filter

LEGEND ,
May 26, 2006 May 26, 2006
I need a tutorial looked at if anybody has the time. I"m learning how to
search multidimensional arrays and I want to ensure that I don't start off
with a bad tutorial.

http://www.desilva.biz/arrays/filter.html Is what I am currently looking
at. It looks like it will do what I'm trying to attempt, but as I'm still
so new to PHP....

I'll post back with my results, because I'm sure I'll have follow-up
questions.

--

Thank you,

Jon Parkhurst


TOPICS
Server side applications
306
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2006 May 26, 2006
OK.

I'm getting the following error on this code, if anybody can take a quick
look. It's from the tutorial I posted, which seems to be exactly what I'm
looking for. I think it's just my PHP notation that is off right now.

What I am attempting to do is create array, $mcGroups which contains
several arrays that link the Group to the Level of clearance, for all
records in the recordset rsGroupAccess.

Can I not put a while inside an array statement? Can anybody suggest a
means to accomplish what I'm looking for?

$mcGroups = array(
do {
$rsGroupAccess['gaGroup']=>array(
$rsGroupAccess['gaLevel'])
} while ($row_rsGroupAccess = mysql_fetch_assoc($rsGroupAccess));
);



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2006 May 26, 2006
crash wrote:
> Can I not put a while inside an array statement?

No. When using a loop, you can add new items to an array with array_push():

www.php.net/manual/en/function.array-push.php

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 30, 2006 May 30, 2006
LATEST
;o) Thanks David. That's exactly what I was looking for. What a great
Monday!

Jon

"David Powers" <david@example.com> wrote in message
news:e57u5k$ngm$1@forums.macromedia.com...
> crash wrote:
>> Can I not put a while inside an array statement?
>
> No. When using a loop, you can add new items to an array with
> array_push():
>
> www.php.net/manual/en/function.array-push.php
>
> --
> David Powers
> Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
> Author, "Foundation PHP 5 for Flash" (friends of ED)
> http://foundationphp.com/


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines