Mysql Update and Replace Syntax in PHP -


i need eliminate character (") column in database. can in mysql command line following command:

mysql> update tname set colname=replace(colname, '"',''); 

and works perfectly. since need run in php, have used following syntax in php dosent work :

$sql0 = "update tname set colname=replace(colname,'"','')"; if (mysqli_query($conn, $sql0)) { $result0 = "unwanted character removed "; } else { $result0 = "error filtering failed: " . $sql . "<br>" .       mysqli_error($conn); } 

any idea??

you have escape double quotes inside double-quoted strings.

$sql0 = "update tname set colname=replace(colname,'\"','')"; if (mysqli_query($conn, $sql0)) {   $result0 = "unwanted character removed "; } else {   $result0 = "error filtering failed: " . $sql . "<br>" . mysqli_error($conn); } 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -