RE: [PHP] Array newbie
| From: | Krznaric Michael | Date: | Fri, 04 Aug 2000 15:50:09 +0000 |
| Subject: | RE: [PHP] Array newbie | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-10156@lists.php.net to get a copy of this message | ||
Hi David,
I am a little unclear as to what you're trying to do? You want to
search your database for records that match $X? And your end result is to
have an array of indexes pointing to the records that match $X?
If this is the case, I wonder why you don't let the database do all
the work for you? I mean what kind of SQL statement are you using?
Mike
-----Original Message-----
From: David VanHorn [mailto:dvanhorn@cedar.net]
Sent: Friday, August 04, 2000 11:43 AM
To: php-general@lists.php.net
Subject: [PHP] Array newbie
I have a function that whips through a database, looking for records that
match $X.
What I'd like to do, is return from the function with an array of indexes
to matching records.
Something like this:
$Name_Array = Check_Name(); #Function which looks for names
$Address_Array = Check_Address();
$CSZ_Array = Check_CSZ():
Within Check_Name, can I do something like:
$Name_Array = array_merge($Name_Array,$Reference)
or do I need to do this?
$Reference_Array = array($Reference);
$Name_Array = array_merge($Name_Array,$Reference_Array);
The idea is that each spin through the Db, when I pick up a match, $Name
array picks up an element, and eventually looks like:
1,19, 33.... to whatever.
In the end, I'll check to see if there are any common elements in all three
arrays.
More elegant that what I'm doing now, I think.
--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net