Hi
I made a simple news system with comments using PHP and MySQL, and it worked great on my local Apache server, both on my Fedora 10 machine, and my Windows 7 one. Now I have a problem though, I uploaded it to a web host and it keeps returning all the ' and " as \' and \".
I believe this is either the web host who by automatic adds them for security reasons or that the MySQL is the wrong collation, but I have not been able to resolve it yet, testing multiple MySQL collations.
Here is a example of a query:
mysql_query("INSERT INTO news (title, poster, text, time) VALUES ('$newstitle', '1', '$newstext', '$time')") or die(mysql_error());
$time
is time();
$newstitle
and $newstext
are parsed from $_POST
and both are ran through mysql_real_escape_string()
before I run the query (I guess this might be the problem, but since it is a part of the security I just don't want to remove it, and since it did not cause problems on my local servers)
Son bir not olarak: benim yerel apache sunucularda I latin1_swedish_ci
web barındıran sunucu üzerinde hangi işe yaramadı vardı.
EDIT:
Onlar veritabanında şöyle:
\'\'\'\"\"\"
Benim yerel olanları yaparken de ekstra ters eğik çizgi yoktu, bu yüzden ekleyerek PHP olmalıdır. İlave backslash'lar çıkaran bir fonksiyon ekleyerek dışında bu çözmek için herhangi bir yolu var mı?