I’m coding server side of a web site and i used this for storing the post
if(!(mysql_query("INSERT INTO `post-data`(`site`, `source`, `meta-desc`, `title`, `figure`, `post`,`date`, `tags`, `category`) VALUES ('$this->site','$url','$this->meta_desc','$this->title','$this->figure',htmlentities($this->body),NOW(),'','')"))){
echo mysql_error();
die("DB_in_post Error");}
I had no problem since when i was testing a sample post i got mysql syntax error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘
as a person ‘ at Line 20
when i use htmlentities i see this error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘hello’, ‘world’, ‘foo’ => ‘bar’);
if you want’ at line
Post_Link this is an image from the part of post that is making error the post is about coding
so any idea what should i do?
Looks like a quoting issue by your call to
htmlentities()(which I changed tomysql_real_escape_string())