Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Losing variable values when passed to library
#5

[eluser]tonanbarbarian[/eluser]
I was only asking about CI versions in case you were still using CI 1.5.3 in which case I was going to suggest looking at the core code in 1.5.3 to see if the issue is there.

But since gtech has got it to work in 1.5.3 it seems like it might be your version of php that is the issue.

However I think I might have a solution

After looking into the CI core code I found the following
$this->db->escape will call $this->db->escape_str
$this->db->escape_str is specified in each different database library
For MySQL $this->db->escape_str uses the PHP mysql_real_escape_string function if it exists, which it should for you because it was introduced in PHP 4.3.0

Now mysql_real_escape_string uses a database connection to connect to the mysql server and get it to return the escaped string using an internal MySQL function call.
If the connection does not exist mysql_real_escape_string attempts to make its own connection.
mysql_real_escape_string returns the escaped string or false it there was an error, like an invalid connection

So I think there is an issue with the database connection and mysql_real_escape_string is returning false.
Because if you do the following (which is sort of what $this->db->escape will be doing
Code:
echo "'".false."'"
you will get
Code:
''
because if you convert the boolean FALSE to a string type you get an empty string

So check that your database connection is valid in the code
Make sure that you have actually connected to the database and performed a simple query.
I am guessing the issue may be that the config for the database is not correct but I could be wrong

hope this points you in the right direction


Messages In This Thread
[SOLVED] Losing variable values when passed to library - by El Forum - 12-10-2007, 11:56 PM
[SOLVED] Losing variable values when passed to library - by El Forum - 12-11-2007, 12:11 AM
[SOLVED] Losing variable values when passed to library - by El Forum - 12-11-2007, 04:15 AM
[SOLVED] Losing variable values when passed to library - by El Forum - 12-11-2007, 09:08 PM
[SOLVED] Losing variable values when passed to library - by El Forum - 12-11-2007, 10:12 PM
[SOLVED] Losing variable values when passed to library - by El Forum - 12-16-2007, 09:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB