Welcome Guest, Not a member yet? Register   Sign In
Call to a member function real_escape_string() on boolean
#8

(11-09-2017, 04:01 AM)Narf Wrote:
(11-08-2017, 10:24 PM)kaustubh.agrawal2000 Wrote: but not sure why its failing only when there is string in where clause ??
I mean. everything works fine when I select on primary key....

It's not failing because there's a string in the WHERE clause.
It's the exact opposite - a connection is required to escape the string, and because the connection has failed before that (or was never created in the first place), the escaping of the said string fails.

You're not getting the error on a select() call because there's nothing to escape in there and thus no attempt is made to use the DB connection. That doesn't mean it works fine; it will still fail when the query is actually executed, which happens after you call get().

(11-08-2017, 10:24 PM)kaustubh.agrawal2000 Wrote: Is it something to do with the sessions library ??

No.

Hello..
I am not sure what was the actual problem with this.. but it seems to be gone now..
I was creating 2 connections to same MYSQL port (1 for master and 1 for slave... which I planned to change on prduction. but was same on local).. it is that part which was creating the problem..

when I removed that and started using only 1 connection its working like a charm.... Although still not sure what the problem was with that...

Same logic used to work with previous version of Codeigniter that I used.
Reply


Messages In This Thread
RE: Call to a member function real_escape_string() on boolean - by kaustubh.agrawal2000 - 11-15-2017, 08:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB