Welcome Guest, Not a member yet? Register   Sign In
converting sql query strings to query builder
#11

Thanks. That helps.

That said, I took this query last night and did just as you suggest below. I had been having problems "Commands Out of Sync Error" errors and spent some time last night not worrying about this query, but what I was working on involved stored procs and functions. i was trying to resolve this thinking it was the culprit. it was not. its now working just fine. thanks to doing the next-result call at the end and freeing up the results.

i know its multiple topics but they seemed originally to have been related. clearly, at this point, I know they are not. thanks to those of you whose opinions and advice were offered.

(10-07-2016, 09:51 AM)daveĀ friend Wrote:
Quote:under what circumstances would it no longer be a waste of time and (mental) energy? just trying to understand

A couple of possible circumstances come to mind. The first is a case requiring an extra "where" statement (or two, or more) based on some conditions(s).

The second is where you are implementing pagination. Typically you want a count of all relevant records before applying a limit & offset and retrieving that sub-set of records. Query Builder makes this process easy to implement.

That said, most of the time good old
Code:
$this->db->query('YOUR QUERY HERE');
is easier and more efficient.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB