<?php
include("head.php");
include("config.php");
//connect to db
$shopid = $_POST['sid'];
$name = $_POST['name'];
$cost = $_POST['cost'];
$image = $_POST['image'];
$desc = $_POST['desc'];
//get stuff
$query = " INSERT INTO stuff (title, description, cost, image, shop_id) VALUES($name, $desc, $cost, $image, $shopid)";
echo mysql_error();
//insert
mysql_query($query) or die(mysql_error());
mysql_close();
echo 'Item Added!<br />
Click <a href="addstuff.php?shopid='.$shopid.'">here</a> to go back';
//print go back link
?>
That is me code.
This is me 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 'item, test item, 100, http://blumoney.latestdot.net/images/logo.gif, 1)' at line 1