I have a query that has this as part of it:
$this->db->where(array(
'jobs.open_intentions' => 1,
'jobs.open' => 1,
'jobs.pending' => 0,
'jobs.awarded' => 0));
Which works fine, but I don’t like that format, actually I would much rather write it like
$this->db->where('jobs.open_intentions', 1)
->where('jobs.open', 1)
->where('jobs.pending', 0)
->where('jobs.awarded', 0);
Nit picking I know, but anyway, my question is, is there any reason I should choose one method over the other or is it just a matter of preference?
Semantically speaking, the latter (multiple
wheres) feels more like multipleAND-clauses to me. With the former, the intent is unclear (without looking at the API docs).