How to count array only if new id

if i want to count this array something like this:

$customerOrder = $this->Order->find('count', array(
                'conditions' => array(
                    'Order.customer_id >=' => '1',
                    'Order.status' => 'Delivered'
                )
            ));

      

I only want to calculate $ customerOrder if Order.customer_id has a new id.

fx: if id 1 has placed 5 orders, then I don't want to count 5, but only as 1 new order.

+3
php mysql cakephp


source to share


No one has answered this question yet

See similar questions:

2
Cake php count distinct

or similar:

4270
Link. What does this symbol mean in PHP?
2776
How can I prevent SQL injection in PHP?
2664
How can I check if a string contains a specific word?
2335
Removing an element from an array in PHP
2263
How to get YouTube video thumbnail using YouTube API?
1065
Link. What does this error mean in PHP?
995
How do I sort a multidimensional array by value?
514
Can I bind an array to an IN () condition?
320
In PHP, how do you change the key of an array element?
192
MySQL: count occurrences of DISTINCT values



All Articles
Loading...
X
Show
Funny
Dev
Pics