Jump to content

[SOLVED] You have an error in your SQL syntax


dropfaith

Recommended Posts

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 'Into, Marks, Medications, NohitZone, Phobias, OtherThoughts, Experience, Afterca' at line 1

 

I need another pair of eyes for this ( i hate this cleint for making this large a form

 


<?php

   
    include("header.php");

$Name = mysql_real_escape_string(trim(stripslashes($_POST['Name'])));
$EmailAddress = mysql_real_escape_string(trim(stripslashes($_POST['EmailAddress'])));
$NameDuringPlay = mysql_real_escape_string(trim(stripslashes($_POST['NameDuringPlay'])));
$Phonenumber = mysql_real_escape_string(trim(stripslashes($_POST['Phonenumber'])));
$WhereDidYouHearOfMissAlice = mysql_real_escape_string(trim(stripslashes($_POST['WhereDidYouHearOfMissAlice'])));
$Location = mysql_real_escape_string(trim(stripslashes($_POST['Location'])));
$LengthOfSession = mysql_real_escape_string(trim(stripslashes($_POST['LengthOfSession'])));
$WhenWouldYouLikeaSession = mysql_real_escape_string(trim(stripslashes($_POST['WhenWouldYouLikeaSession'])));
$Into = mysql_real_escape_string(trim(stripslashes($_POST['Into'])));
$Marks = mysql_real_escape_string(trim(stripslashes($_POST['Marks'])));
$Medications = mysql_real_escape_string(trim(stripslashes($_POST['Medications'])));
$NohitZone = mysql_real_escape_string(trim(stripslashes($_POST['NohitZone'])));
$Phobias = mysql_real_escape_string(trim(stripslashes($_POST['Phobias'])));
$OtherThoughts = mysql_real_escape_string(trim(stripslashes($_POST['OtherThoughts'])));
$Experience = mysql_real_escape_string(trim(stripslashes($_POST['Experience'])));
$Aftercare = mysql_real_escape_string(trim(stripslashes($_POST['Aftercare'])));
$Talkafter = mysql_real_escape_string(trim(stripslashes($_POST['Talkafter'])));
$Communication = mysql_real_escape_string(trim(stripslashes($_POST['Communication'])));
$Music = mysql_real_escape_string(trim(stripslashes($_POST['Music'])));
$MusicalPreferance = mysql_real_escape_string(trim(stripslashes($_POST['MusicalPreferance'])));
$Archetypes = serialize($_POST['Archetypes']);
$OtherNames = mysql_real_escape_string(trim(stripslashes($_POST['OtherNames'])));
$Scenes = serialize($_POST['Scenes']);
$Otherscenes = mysql_real_escape_string(trim(stripslashes($_POST['Otherscenes'])));
$Clothing = serialize($_POST['Clothing']);
$OtherClothing = mysql_real_escape_string(trim(stripslashes($_POST['OtherClothing'])));
$SceneLocations = serialize($_POST['SceneLocations']);
$OtherSceneLocations = mysql_real_escape_string(trim(stripslashes($_POST['OtherSceneLocations'])));
$Psychologicalplay = serialize($_POST['Psychologicalplay']);
$OtherPsychologicalplay = mysql_real_escape_string(trim(stripslashes($_POST['OtherPsychologicalplay'])));
$Sexuality = serialize($_POST['Sexuality']);
$OtherSexuality = mysql_real_escape_string(trim(stripslashes($_POST['OtherSexuality'])));
$Equipment = serialize($_POST['Equipment']);
$OtherEquipment = mysql_real_escape_string(trim(stripslashes($_POST['OtherEquipment'])));
$ScenesEnjoyed = serialize($_POST['ScenesEnjoyed']);
$Safewords = serialize($_POST['Safewords']);
$OtherSafeWords = mysql_real_escape_string(trim(stripslashes($_POST['OtherSafeWords'])));
$PowerExchange = serialize($_POST['PowerExchange']);
$TurnOffs = mysql_real_escape_string(trim(stripslashes($_POST['TurnOffs'])));
$OtherPowerExchange = mysql_real_escape_string(trim(stripslashes($_POST['OtherPowerExchange'])));




      // open database connection
$conn = mysql_connect(HOST, DBUSER, PASS) or  die('Could not connect !<br />Please contact the site\'s administrator.');
$db = mysql_select_db(DB) or  die('Could not connect to database !<br />Please contact the site\'s administrator.');



        // generate and execute query

        $query = "INSERT INTO Alice (Name, EmailAddress, NameDuringPlay, Phonenumber, WhereDidYouHearOfMissAlice, Location, LengthOfSession, WhenWouldYouLikeaSession, Into, Marks, Medications, NohitZone, Phobias, OtherThoughts, Experience, Aftercare, Talkafter, Communication, Music, MusicalPreferance, Archetypes, OtherNames, Scenes, Otherscenes, Clothing, OtherClothing, SceneLocations, OtherSceneLocations, Psychologicalplay, OtherPsychologicalplay, Sexuality, OtherSexuality, Equipment, OtherEquipment, ScenesEnjoyed, Safewords, OtherSafeWords, PowerExchange, TurnOffs, OtherPowerExchange 
) VALUES('Name','$EmailAddress','$NameDuringPlay','$Phonenumber','$WhereDidYouHearOfMissAlice','$Location','$LengthOfSession','$WhenWouldYouLikeaSession','$Into','$Marks','$Medications','$NohitZone','$Phobias','$OtherThoughts','$Experience','$Aftercare','$Talkafter','$Communication','$Music','$MusicalPreferance','$Archetypes','$OtherNames','$Scenes','$Otherscenes','$Clothing','$OtherClothing','$SceneLocations','$OtherSceneLocations','$Psychologicalplay','$OtherPsychologicalplay','$Sexuality','$OtherSexuality','$Equipment','$OtherEquipment','$ScenesEnjoyed','$Safewords','$OtherSafeWords','$PowerExchange','$TurnOffs','$OtherPowerExchange 
')";

        $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());

echo $query;

        // close database connection

        mysql_close($connection);


?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.