I have been using this code to save data into my database:
<?php
include ("dbconnector.php");
$type = stripslashes ($_SESSION['type']);
$title = stripslashes ($_SESSION['title']);
$artist = stripslashes ($_SESSION['artist']);
$description = stripslashes ($_SESSION['description']);
$table = stripslashes ($_SESSION['table']);
$db_sql_query ="INSERT INTO $table (item_type,
item_name,
item_artist,
item_description)
VALUES ($type,
$title,
$artist,
$description)";
//the code below checks that the information has been passed to the database, if it hasnt then a mysql error will be displayed
$db_result = @mysql_query($db_sql_query, $db_connection) or die("Error #". mysql_errno() . ": " . mysql_error());
//if it has the include below will display
echo "the item has been saved <a href=\"new_item.php\">add another</a> ";
?>
and this works fine unless there are speech marks and it then kicks up the following error:
Error #1064: 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 'BOOMA-ABOOMA-ABOOMA-ABOOM"!, the drums kick in'
I'm not sure what the problem is
please help!! 😕