izniburak / pdox

useful query builder class that works with PHP PDO class for simple access your data.
http://burakdemirtas.org/pdox-kullanisli-pdo-sinifi-php/
MIT License
299 stars 105 forks source link

I need a help Bro #81

Closed tonmooy closed 4 years ago

tonmooy commented 4 years ago

Hello bro Suppose i have video_cat id = 19, 20, 22, 21

.now how can i show or list multiple video category item inside $records array from allvideos table $where = [ 'video_cat' => 19, 'status' => 1,

        ];

$where = [ 'video_cat' => 21, 'status' => 1,

        ];

$records = $db->table('allvideos') ->select('*') ->orderBy('id', 'DESC') ->where($where)

            ->getAll();

Thanks in advance

izniburak commented 4 years ago

Hi @tonmooy , Can you try this?

$videoCats = [19, 20, 21, 22];
$records = $db->table('allvideos')->where('status', 1)->in('video_cat', $videoCats)->orderBy('id', 'DESC')->getAll();
tonmooy commented 4 years ago

Hi @tonmooy , Can you try this?

$videoCats = [19, 20, 21, 22];
$records = $db->table('allvideos')->where('status', 1)->in('video_cat', $videoCats)->orderBy('id', 'DESC')->getAll();

Thanks bro You are helpfull