Article written by

2 Responses

Page 1 of 1
  1. Neo85
    Neo85 at | | Reply

    hi,
    why is this
    $q->table(‘table’) ->begin_and() ->begin_and() ->and_where(‘col_1’, 1) ->or_where(‘col_2’, 2) ->end_and() ->end_and() ->or_where(‘col_3’, 3, ‘!=’);
    better than this
    //=>SELECT * FROM table WHERE ( ( col_1 = ‘1’ OR col_2 = ‘2’ ) ) OR col_3 != ‘3’???whats the advantage?

    1. Sean Sandy, BCS
      Sean Sandy, BCS at | | Reply

      It is a lot easier to rewrite it if it is generated by code than if it is hand written. Adding new columns, tables, joins, more fields, more complex joins

Leave a Reply