php - semi-colon breaking mysql_query -


this question has answer here:

i'm adding html code database through mysql_query. so, basic query looks $qry = "update pages set ".$column."='$value' id='$id'";

if called, actual query might this: $qry = "update pages set content_en='<h1>this title</h1>' id='12'"; however, if html code looks this: <h1 style='color:red;'>this title</h1>, it'll break query because of semi-colon. there way solve this?

use mysql escaping function on content, :

$value = mysqli_real_escape_string($value); 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -