tiny mce sql error when adding links

Posted by Anders Kitson on Stack Overflow See other posts from Stack Overflow or by Anders Kitson
Published on 2010-05-27T17:07:38Z Indexed on 2010/05/27 17:11 UTC
Read the original article Hit count: 275

Filed under:
|

I am using tiny mce with a script I built for uploading some content to a blog like system. Whenever I add a link via tiny mce I get this error. The field type in mysql for $content which is the one carrying the link is longblob if that helps.

here is the link error first and then my code

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 'google test" href="http://www.google.ca" target="_blank">google est laborum' at line 4

/* GRAB FORM DATA */
 $title = $_POST['title'];
 $date = $_POST['date'];
 $content = $_POST['content'];
 $imageName1 = $_FILES["file"]["name"];
 $date = date("Y-m-d");

 $sql = "INSERT INTO blog (title,date,content,image)VALUES(
 \"$title\",
 \"$date\",
 \"$content\",
 \"$imageName1\"
 )";

 $results = mysql_query($sql)or die(mysql_error());

© Stack Overflow or respective owner

Related posts about php

Related posts about tinymce