Can I use SQL array as in Dibi?
- Robin Martinez
- Member | 89
Hi,
I love Dibi and use it a lot. I heavily used sql array to feed Dibi such as:
$q = []
array_push('SELECT * FROM %n', $table);
array_push('WHERE id > %d', $id);
$res = dibi::fetchAll($q);
I guess this is not possible in Nette Database? The only ‘similar’ method I found is:
$q = $args = [];
$q[] = "SELECT * FROM ?";
$args[] = $table;
$q[] = "WHERE id > ?";
$args[] = $id;
$res = $this->db->fetchAll(implode(' ', $q), ...$args);
Or is there any ‘cleaner’ method? Thanks!
- Robin Martinez
- Member | 89
I just started a new job, where Nette is used. So I'd like to know if I can use old habits :)