שלום לכולם,
אני משתמש בעורך TinyMCE
ואני מנסה להכניס את מה שקיבלתי מהעורך ל mysql:
PHP קוד:
<?php
require "function.php";
echo connection_db();
if (isset($_POST['elm1'])){ //admin
$elm1 = htmlspecialchars($_POST['elm1']);
mysql_query("INSERT INTO `admin` (index) VALUES ('$elm1')") or die(mysql_error());
echo $elm1;
}
?>
אבל זה מדפיס לי את השגיאה:
PHP קוד:
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 'index) VALUES ('<span class="example1">Test head
לפי מה שהבנתי השגיאה היא שסוג המסד לא יכול לקבל ערכים של html ...
איך מסדרים את זה?
תודה מראש