$select=$db->select('categories', ['column'=>'category_subid', 'value'=>$id, 'order'=>'category_row', 'sort'=>'ASC']);
SELECT * from categories where categoy_id=? order by category_row ASC;
$select->execute(array($option['value']));
Ama bu işlem bu kadar uzana bilir
SELECT * from categories where categoy_id=? and categoy_subid=? and categoy_status=? order by category_row ASC;
$select->execute(array($option['value',$subid,$status]));
Yukarıdakı gibi nasıl bişey yapa bilirim if lerin sayın artırmak yerinə daha kolay bir yolu olmalı
if(isset($option['column']) && isset($option['order'])){
$select=$this->db->prepare("SELECT * from $table where {$option['column']}=? order by {$option['order']} {$option['sort']}");
$select->execute(array($option['value']));
}else{
$select=$this->db->prepare("SELECT * from $table");
$select->execute();
}
$finish=$select->fetchALL(PDO::FETCH_ASSOC);
return $finish;