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
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
Post a Comment