PHP escaping encoded quotes

Oylttnlecavtd

New Member
I have following piece of code which posts some data into database:\[code\]$post = trim( $post );$post = htmlentities( $post, ENT_QUOTES, null, false );$statement = "INSERT INTO table (row) VALUES (:message)";$prepared_posts = $pdo->prepare( $statement );$prepared_posts->execute( array( ':message' => $post ) );\[/code\]I have MySQL version \[code\]5.1.47-community\[/code\] on both localhost and staging / production server, but I'm getting different output on both of them. On localhost I'm running \[code\]PHP 5.3.2\[/code\], production server has \[code\]PHP 5.2.14\[/code\].If I'm trying to post sentence \[code\]that's "ok"\[/code\], on production it saves \[code\]that\'s \"ok\"\[/code\], localhost produces correct \[code\]that's "ok"\[/code\].What could be causing this? Could it be some MySQL setting? I also tried using \[code\]mysqli\[/code\] instead of \[code\]PDO\[/code\] and it does the same thing.
 
Back
Top