Welcome Guest, Not a member yet? Register   Sign In
Escape Strings before saving in the data base
#1

[eluser]briandkid[/eluser]
Hi Guys,

Before using code igniter, for my database i used mysqli. And i escaped strings using the real_escape_string method. For codeigniter, i use $this->db->escape_str(). However this is a problem when it comes to data from my textareas. At each new line i get an "n" instead.

Whereas if i post without applying the function, it does not show the same problem.

I wanted to use Addslashes but since it will be deprecated by php 6 and it's not that secure for mysql injections, i omitted it.

My server configuration displays that i have magic quotes on i.e get_magic_quotes_gpc() returns true.

Please does any one have an alternative to solve this problem?
Thanks a lot.
#2

[eluser]Dr. Seuss[/eluser]
did anyone ever solve this? I have the same issue.
#3

[eluser]briandkid[/eluser]
Please does any one have a solution?
#4

[eluser]Dr. Seuss[/eluser]
briandkid,

are you using mysqli?
#5

[eluser]briandkid[/eluser]
Before codeigniter, yes.

But now i just use the db object of codeigniter. And i use LAMP so i guess it's mysql.




Theme © iAndrew 2016 - Forum software by © MyBB