cakephp - Cake php get comma seprated value from mysql table -


i trying fetch comma separated record in php mysql not getting error getting not record. sql code want execute is:

select batches.id, batches.batch_name, batches.facilities_id, batches.archive_status, batches.created  sportsapp.batches batches  batches.facilities_id in (40, 48, 110, 111) 

and records like

record set[1]

my current php approach is:

$batches = $this->batches->find ( 'all',               array(                 'conditions' => array(                   'batches.facilities_ids' => $facilitiesids                  )               )             ); 

you can't find directly comma separated value in approach. use find_in_set

e.g

array('conditions' => array('batche.archive_status' => 1,'find_in_set(\''. $id .'\',batches.facilities_id)')) 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -