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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -