# I m facing this error syntax error, unexpected '=\>' (T\_DOUBLE\_ARROW), expecting ',' or ')'

**URL:** https://discourse.cakephp.org/t/i-m-facing-this-error-syntax-error-unexpected-t-double-arrow-expecting-or/2510
**Category:** Need Help
**Created:** [May 3, 2017, 1:22pm UTC](https://discourse.cakephp.org/t/i-m-facing-this-error-syntax-error-unexpected-t-double-arrow-expecting-or/2510 "2017-05-03T13:22:32Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Shoeb](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shoeb](https://discourse.cakephp.org/u/Shoeb)
#### Post date: [May 3, 2017, 1:22pm UTC](https://discourse.cakephp.org/t/i-m-facing-this-error-syntax-error-unexpected-t-double-arrow-expecting-or/2510/1 "2017-05-03T13:22:32Z")

</div>

This is my code in TablesController…

$curt\_date = date(‘Y-m-d’);  
$bills = TableRegistry::get(‘bills’);  
$bill\_product = $bills-\>find(‘all’,  
array(‘conditions’ =\> array(‘bills.added\_date’ =\> $curt\_date)),  
‘fields’ =\> array([  
‘product\_id’,  
‘sum(quantity) as quantity\_TOTAL’,  
‘sum(productprice) as Total’]),  
‘group’ =\> ‘product\_id’);

---

<div class="post-metadata">

### Author: ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)
#### Post date: [May 3, 2017, 6:42pm UTC](https://discourse.cakephp.org/t/i-m-facing-this-error-syntax-error-unexpected-t-double-arrow-expecting-or/2510/2 "2017-05-03T18:42:59Z")

</div>

```
$bill_product = $bills->find(
    'all',
    array(
        'conditions' => array(
            'bills.added_date' => $curt_date
        ),
        'fields' => array(
            'product_id',
            'sum(quantity) as quantity_TOTAL',
            'sum(productprice) as Total'
        ),
        'group' => 'product_id'
    )
);

```

Why do not you use an IDE with syntax highlighting?

---

<div class="post-metadata">

### Author: ![Shoeb](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@Shoeb](https://discourse.cakephp.org/u/Shoeb)
#### Post date: [May 4, 2017, 6:01am UTC](https://discourse.cakephp.org/t/i-m-facing-this-error-syntax-error-unexpected-t-double-arrow-expecting-or/2510/3 "2017-05-04T06:01:51Z")

</div>

Thanks rrd,  
I have try to your provide code in my code but unfortunately getting error as attachments… ![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/cakephp/original/1X/3223755be6dc0e7e1c93517707869bc4ee87084f.png)

---

<div class="post-metadata">

### Author: ![hanuka](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hanuka](https://discourse.cakephp.org/u/hanuka)
#### Post date: [May 8, 2017, 11:30am UTC](https://discourse.cakephp.org/t/i-m-facing-this-error-syntax-error-unexpected-t-double-arrow-expecting-or/2510/4 "2017-05-08T11:30:28Z")

</div>

Try this  
// Results in SELECT id AS pk, title AS aliased\_title, body …  
$query = $articles-\>find();  
$query-\>select([‘pk’ =\> ‘id’, ‘aliased\_title’ =\> ‘title’, ‘body’]);

---

<div class="post-metadata">

### Author: ![akkaweb](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/akkaweb/32/53_2.png) [@akkaweb](https://discourse.cakephp.org/u/akkaweb)
#### Post date: [May 8, 2017, 3:46pm UTC](https://discourse.cakephp.org/t/i-m-facing-this-error-syntax-error-unexpected-t-double-arrow-expecting-or/2510/5 "2017-05-08T15:46:34Z")

</div>

Try this

```
$bill_product = $bills->find(
    'all', 
    array(
        'conditions' => array(
            'bills.added_date' => $curt_date
        ),
        'fields' => array([
            'product_id',
            'sum(quantity) as quantity_TOTAL',
            'sum(productprice) as Total'
        ]),
        'group' => 'product_id'
    )
);
```
