Welcome Guest, Not a member yet? Register   Sign In
Query bindings keep unwanted quotes around IS NULL
#6

(This post was last modified: 07-22-2016, 07:57 AM by meow. Edit Reason: clarity )

(07-21-2016, 03:22 PM)InsiteFX Wrote: Did you try using double quotes for the query body?

Man, I tried everything lol. Tried concatenating and changing up the quote types all around. You think its worth looking into? I know ci is doing it to produce safer queries.

(07-22-2016, 06:33 AM)Avenirer Wrote: A stupid question: If it's you who defines the value of $archived (in the code...), why put it as parameter and not simply concatenate it inside the string of the query?

That's a good question and its fair to ask a stupid question if you are wanting to learn something (or you asking in order to hack my website? kidding..) That parameter is handy when using it from the controller:

Setting it to TRUE in the controller calls the model method and
setting it to FALSE can change things up in a quickie (not a seasoned php writer/veteran here).

It should probably help you to see the SQL design to understand this further, let me know.

Controller preview
Code:
$data['my_active_logbooks'] = $this->logbook_model->get_my_logs($this->session->userdata('person_id'),FALSE,$this->session->userdata('sorting'));

$data['my_archived_logbooks'] = $this->logbook_model->get_my_logs($this->session->userdata('person_id'),TRUE,$this->session->userdata('sorting'));

I probably misunderstood your question though.
Reply


Messages In This Thread
RE: Query bindings keep unwanted quotes around IS NULL - by meow - 07-22-2016, 07:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB