If someone can help me with this I would be eternally grateful here.
I have created a form on one page with php validation. Once cleared through the validation I have Sessioned the inputted data to catch them on the "insert data page"
on the "insert data page" I have this bit of coding:
// GET POST DATA AND CREATE VARIABLES $city = $_SESSION['city']; $state = $_SESSION['state']; $zip = $_SESSION['zip']; $address = $_SESSION['address']; $unit = $_SESSION['unit']; $price = $_SESSION['price']; $beds = $_SESSION['beds']; $baths = $_SESSION['baths']; $sqft = $_SESSION['sqft']; $propType = $_SESSION['proptype']; echo $id, $city, $state, $zip, $address, $unit, $price, $beds, $baths, $sqft, $propType; include ('includes/conn.inc.php'); // INSERT DATA FROM FORM ONCE THE FORM HAS BEEN SUBMITTED AND VALIDATED $sql="INSERT INTO table_name (id, city, state, zip, address_no_street, unit_no, price, beds, baths, sqft, property_type, date) VALUES ('$id', '$city', '$state', '$zip', '$address', '$unit', '$price', '$beds', '$baths', '$sqft', '$propType', NOW())"; mysql_query($sql) or die ('Something went wrong with submitting your information');
All variables are echoing properly so the data gets this far. The INSERT however does not fire. I have checked and rechecked my DB for misspells or errors but see none. Is there something I am missing here.
I tried this and it works perfectly:
$sql="INSERT INTO table_name (id, city, state, zip, address_no_street, unit_no, price, beds, baths, sqft, property_type, date) VALUES ('id', 'city', 'state', 'zip', 'address', 'unit', 'price', 'beds', 'baths', 'sqft', 'propType', NOW())"; mysql_query($sql) or die ('Something went wrong with submitting your information');
the variables are not getting in there for some reason and I can't figure out why.
Really appreciate any help on this.