PHP warning

count(): Parameter must be an array or an object that implements Countable

/home/yangroodyo/domains/xn--22ck6bdp5cach0mc23a.com/public_html/themes/web/views/product/view_cart.php(25)

13                 <tr class="table-head" style="height:100px">
14                     <th class="col-md-3">ภาพสินค้า</th>
15                     <th class="col-md-2">รหัสสินค้า</th>
16                     <th class="col-md-2">สินค้า</th>
17                     <th class="col-md-2">ราคา</th>
18                     <th class="col-md-4">จำนวน</th>
19                     <th class="col-md-1">รวม</th>
20                     <th class="col-md-1">#</th>
21                 </tr>
22                 <?php
23                   $total_num2=0;
24                   $total2=0;
25                     if (count($_SESSION['row']) !== 0) {
26 
27                         $nn = 1;
28                         foreach ($_SESSION['row'] as $key => $data_cart) {
29                             $product = Yii::app()->db->createCommand()
30                                     ->select('*, p.pro_id as pro_id2')
31                                     ->from('product p')
32                                     ->join('pd_unit u', 'u.unit_id = p.unit_id')
33                                     ->where('p.pro_id=:id', array(':id' => $data_cart[0]))
34                                     ->queryRow();
35                             $img = Yii::app()->db->createCommand()
36                                     ->select('img_name')
37                                     ->from('pd_img')

Stack Trace

#4
+
 /home/yangroodyo/domains/xn--22ck6bdp5cach0mc23a.com/public_html/protected/controllers/frontend/ProductController.php(381): CController->render("product/view_cart")
376             'inv_date' => $_REQUEST['inv_date']
377         ));
378     }
379 
380     public function actionView_cart() {
381         $this->render('product/view_cart');
382     }
383 
384     public function actionForm_edit_pd() {
385         $this->layout = 'Product';
386         $this->render('form_insert_pd');
#12
+
 /home/yangroodyo/domains/xn--22ck6bdp5cach0mc23a.com/public_html/protected/components/WebApplicationEndBehavior.php(25): CApplication->run()
20         // Attach the changeModulePaths event handler
21         // and raise it.
22         $this->onModuleCreate = array($this, 'changeModulePaths');
23         $this->onModuleCreate(new CEvent($this->owner));
24  
25         $this->owner->run(); // Run application.
26     }
27  
28     // This event should be raised when CWebApplication
29     // or CWebModule instances are being initialized.
30     public function onModuleCreate($event)
#14
+
 /home/yangroodyo/domains/xn--22ck6bdp5cach0mc23a.com/public_html/index.php(10): CComponent->__call("runEnd", array("frontend"))
05 // Remove the following lines when in production mode
06 defined('YII_DEBUG') or define('YII_DEBUG', true);
07 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
08  
09 require_once($yii);
10 Yii::createWebApplication($config)->runEnd('frontend');
2024-03-29 18:53:13 Apache/2 Yii Framework/1.1.14