i fetched data database. example of artist data 10,11,12 (comma separated values), each values have corresponding data table. after formatting , getting values, data artist column not searchable. hope understand i'm trying say. question how make artist data searchable? thank in advance. here's code columns array:
$columns = array( array('db' => '`t`.`track_id`', 'dt' => 0, 'formatter' => function($a){return '<a href="tracks-view.php?id='.$a.'">'.$a.'</a>';}, 'field' => 'track_id'), array('db' => '`t`.`upc`', 'dt' => 1, 'field' => 'upc'), array('db' => '`t`.`isrc`', 'dt' => 2, 'field' => 'isrc'), array('db' => '`t`.`tracktitle`', 'dt' => 3, 'field' => 'tracktitle'), array('db' => '`t`.`artist`', 'dt' => 4, 'formatter' => function($a,$row){ if($a !=''){ $ab = explode(',',$a); $artist =""; $db = new database(); $db->connect(); foreach ($ab $artindex => $artvalue) { $q_a ='select fname rartist id = '.$artvalue; $r_a = $db->query($q_a); $a_a = $db->fetch_array_assoc($r_a); $a_id = $artvalue; $a_name = $a_a['fname']; if(end($ab)==$artvalue){ $artist .= '<span>'.$a_name.'</span>'; }else{ $artist .= '<span>'.$a_name.'</span>, '; } } return $artist; }else{return $artist='';} }, 'field' => 'artist'), array('db' => '`t`.`publisher`', 'dt' => 5, 'field' => 'publisher'), array('db' => '`t`.`licensor`', 'dt' => 6, 'field' => 'licensor'), array('db' => '`t`.`genre`', 'dt' => 7, 'field' => 'genre'), array('db' => '`t`.`discno`', 'dt' => 8, 'field' => 'discno'), array('db' => '`t`.`trackno`', 'dt' => 9, 'field' => 'trackno') );
any answer highly appreciated. thank you.
Comments
Post a Comment