Problem with form iserting data to database.
I get the following message
The Journey of a Thousand Miles Begins with the First Step...
Code:
<?
// create short variable names
$staddress=$_POST['staddress'];
$city=$_POST['city'];
$state=$_POST['state'];
$zip=$_POST['zip'];
$proptyp=$_POST['proptyp'];
$bednum=$_POST['bednum'];
$bathnum=$_POST['bathnum'];
$intsqr=$_POST['intsqr'];
$lotsize=$_POST['lotsize'];
$price=$_POST['price'];
$archtype=$_POST['archtype'];
$feature0=$_POST['feature0'];
$feature1=$_POST['feature1'];
$feature2=$_POST['feature2'];
$feature3=$_POST['feature3'];
$feature4=$_POST['feature4'];
$feature5=$_POST['feature5'];
$feature6=$_POST['feature6'];
$feature7=$_POST['feature7'];
$highschool=$_POST['highschool'];
$midschool=$_POST['midschool'];
$eleschool=$_POST['eleschool'];
$staddress = addslashes($staddress);
$city = addslashes($city);
$state = addslashes($state);
$zip = addslashes($zip);
$proptyp = addslashes($proptyp);
$bednum = addslashes($bednum);
$bathnum = addslashes($bathnum);
$intsqr = addslashes($intsqr);
$lotsize = addslashes($lotsize);
$price = addslashes($price);
$archtype = addslashes($archtype);
$feature0 = addslashes($feature0);
$feature1 = addslashes($feature1);
$feature2 = addslashes($feature2);
$feature3 = addslashes($feature3);
$feature4 = addslashes($feature4);
$feature5 = addslashes($feature5);
$feature6 = addslashes($feature6);
$feature7 = addslashes($feature7);
$highschool = addslashes($highschool);
$midschool = addslashes($midschool);
$eleschool = addslashes($eleschool);
$db = mysql_pconnect('localhost', 'DB_user', 'PASSWORD');
if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
mysql_select_db('realest1_proppost');
$query = "INSERT propertys SET staddress='$staddress', city='$city', state='$state', zip='$zip', proptyp='$proptyp', bednum='$bednum', bathnum='$bathnum', intsqr='$intsqr', lotsize='$lotsize', price='$price', $archtype='$$archtype', feature0='$feature0', feature1='$feature1', feature2='$feature2', feature3='$feature3', feature4='$feature4', feature5='$feature5', feature6='$feature6' feature7='$feature7' highschool='$highschool' midschool='$midschool' eleschool='$eleschool'";
$result = mysql_query($query) or die(mysql_error());
?>
I get the following message
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 '='$', feature0='', feature1='', feature2='', feature3='', featu
The Journey of a Thousand Miles Begins with the First Step...