php - pgsql string escape when inserting -
i new postgresql, trying insert html code data base text cant inserted such single quotes example. looking code me "trim" or allow allow characters inserted. have tried following code didnt work.
$title= $_post['title']; $intro= $_post['intro']; $content= $_post['content']; $category= $_post['category']; $sort_footer = 24; //insert code $stmt = $dbh->prepare("insert content(title, intro, content, category, sort_footer ) values ( :title, :intro , :content , :category ,:sort_footer ) "); $stmt->bindparam(':title', $title); $stmt->bindparam(':intro', $intro); $stmt->bindparam(':content', $content); $stmt->bindparam(':category', $category); $stmt->bindparam(':sort_footer', $sort_footer); $stmt->execute();
Comments
Post a Comment