REPLACE command

Codes here !

Moderators: egami, macek, gesf

Post Reply
AlexYachtCrew
New php-forum User
New php-forum User
Posts: 18
Joined: Mon Mar 19, 2018 8:57 am

Tue Mar 27, 2018 9:44 am

I'm trying to stripslashes which worked until my server updated my PHP 5.2 to 5.4. I saw the solution with REPLACE and I've tried to add that but to no avail. Please help if you can. Below is the query. How do I add REPLACE to run properly? Here's the code below:

$db = @mysql_select_db($db_name, $connection) or die(mysql_error());
$sql = "INSERT INTO $table_name

(id, order_name, date_taken, name, l_name, housename1, address1, citystate1) VALUES
REPLACE(REPLACE(housename1, '\\\'', '\''), '\\\"', '\"') AS housename1_fixed

('', '$_POST[housename1]', '$_POST[address1]')";
$result = @mysql_query($sql,$connection) or die(mysql_error());

Post Reply