RE: [PHP] Still bugging me..
| From: | Krznaric Michael | Date: | Tue, 15 Aug 2000 14:30:49 +0000 |
| Subject: | RE: [PHP] Still bugging me.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11810@lists.php.net to get a copy of this message | ||
Ok, i'm sure you've probably figured it out by now, if you didn't did you
try
array_intersect ($Result_A, $Result_B, $Result_C)
http://www.php.net/manual/function.array-intersect.php
Mike.
-----Original Message-----
From: David VanHorn [mailto:dvanhorn@cedar.net]
Sent: Friday, August 11, 2000 4:18 PM
To: php
Subject: [PHP] Still bugging me..
I have the results of three mysql queries, which may contain zero or more
(or many many more) records.
I'm trying to find an efficient way to trim this set and only look at those
which have one field in common.
IOW:
After three queries, I have these sets:
$Result_A
$Result_B
$Result_C
Each has a field called reference, (plus several other fields) and the
records within Result_A might have reference = 10,11,12,13. Result_B might
have reference = 11,12,13,14, and $Result_C might have reference =
12,13,14,15,16
What I want is to discard, or to only pay attention to the records where in
this case, reference is 12 or 13.
The problem is that I have to search on other fields in the records to find
out which are potentially interesting.
I do need all the data for the congruent set though, not just the reference
numbers, although I suppose I could then re-fetch them, but it seems a
waste.
In some cases, these may be large sets, so I really don't want to loop
through. If each returned 1000 records, then the result would be a
frighteningly large search.
--
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