-2

Controller part code

$Viewcustomer=$this->Viewcustomer->query("SELECT GROUP_CONCAT(usertype_name SEPARATOR ',') as usertypename, customer_name FROM `pre`.`customer` AS `Viewcustomer` WHERE `Viewcustomer`.`customer_status` = 0 AND `Viewcustomer`.`customer_type` = 'B1'  
GROUP BY `customer_id`  DESC"); 
$this->set("Viewcustomer",$Viewcustomer);

view part code

 foreach($Viewcustomer as $customers){
  echo  $customers['Viewcustomer']['usertypename'];
    }
disha
  • 11
  • 1
  • 2

1 Answers1

0

usertypename should not come in $customers['Viewcustomer']['usertypename'];
this should be
$customers['0']['usertypename'];
please print your array and share your code

Akshay Sharma
  • 1,042
  • 1
  • 8
  • 21