Hi folks,
I just wanted to add a little something to this thread as I reworked
some of the code and came across an interesting tidbit. I was trying
to merge many result sets which now had the table's primary key as the
array key, but found that when array_merge() was done, all of the
array's keys
> Give it a try, should do what you are wanting.
Hi Jim,
I appreciate your dedication to this problem but it was solved 2 days ago! :)
Thanks
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 12/15/2011 6:24 AM, Marc Guay wrote:
>> Assuming you want to make things unique based on the "contact_first_name"
>> field,
>> how would you decide which record to keep? The first one you run in to, the
>> last one you come across, or some other criteria?
>
> The unique field is actually the
> Assuming you want to make things unique based on the "contact_first_name"
> field,
> how would you decide which record to keep? The first one you run in to, the
> last one you come across, or some other criteria?
The unique field is actually the contact_id.
Marc
--
PHP General Mailing List (
On 12/13/2011 1:15 PM, Marc Guay wrote:
> Hi folks,
>
> Let's say that I have the following array:
>
> [0]=>
> array(35) {
> ["contact_id"]=>
> string(3) "356"
> ["contact_first_name"]=>
> string(4) "Marc"
> }
> [1]=>
> array(35) {
> ["contact_id"]=>
> string(3) "
Marc Guay wrote:
If the contact_id is the primary key, you could also use that as array
index, which would automatically filter duplicates.
Thanks for this, it's so obvious I didn't see it. I was adding items
to the array with $array[] = $contact when I could have just as easily
used $array[$c
> If the contact_id is the primary key, you could also use that as array
> index, which would automatically filter duplicates.
Thanks for this, it's so obvious I didn't see it. I was adding items
to the array with $array[] = $contact when I could have just as easily
used $array[$contact['id']] =
On Tue, Dec 13, 2011 at 10:15 PM, Marc Guay wrote:
> Hi folks,
>
> Let's say that I have the following array:
>
> [0]=>
> array(35) {
> ["contact_id"]=>
> string(3) "356"
> ["contact_first_name"]=>
> string(4) "Marc"
> }
> [1]=>
> array(35) {
> ["contact_id"]=>
> string(3) "
On Tue, 2011-12-13 at 16:15 -0500, Marc Guay wrote:
> Hi folks,
>
> Let's say that I have the following array:
>
> [0]=>
> array(35) {
> ["contact_id"]=>
> string(3) "356"
> ["contact_first_name"]=>
> string(4) "Marc"
> }
> [1]=>
> array(35) {
> ["contact_id"]=>
>
Hi folks,
Let's say that I have the following array:
[0]=>
array(35) {
["contact_id"]=>
string(3) "356"
["contact_first_name"]=>
string(4) "Marc"
}
[1]=>
array(35) {
["contact_id"]=>
string(3) "247"
["contact_first_name"]=>
string(4) "Marc"
}
[2]=>
a
10 matches
Mail list logo