3 Replies Latest reply: Oct 9, 2014 10:54 AM by Rob Hecker2 RSS

    Insert Code Error

    Max Resnikoff Community Member

      Can anyone help me find the error in this code please?

      There is a code below this that sends an email, and it all works fine, but the data isnt being posted into the database for some reason (This code).

       

       

      <?php

      $con= require_once('../../connections/djdirect.php');

       

      $firstname = ($_POST['firstname']);

      $lastname = ($_POST['lastname']);

      $email = ($_POST['email']);

      $mobilenumber = ($_POST['mobilenumber']);

      $date = ($_POST['datepicker']);

      $timestart = ($_POST['timestart']);

      $timeend = ($_POST['timeend']);

      $addressline1 = ($_POST['addressline1']);

      $addressline2 = ($_POST['addressline2']);

      $addresscity = ($_POST['addresscity']);

      $addresscounty = ($_POST['addresscounty']);

      $addresspostcode = ($_POST['addresspostcode']);

      $package = ($_POST['package']);

      $addons = ($_POST['addons']);

      $comments = ($_POST['comments']);

      $discountcode = ($_POST['discountcode']);

       

      $sql = "INSERT INTO quote (firstname, lastname, email, mobile, date, timestart, timeend, addressline1, addressline2, addresscity, addresscounty, addresspostcode, package, addons, comments, discountcode) VALUES ('$firstname', '$lastname', '$email', '$mobilenumber', '$date', '$timestart', '$timeend', '$addressline1', '$addressline2', '$addresscity', '$addresscounty', '$addresspostcode', '$package', '$addons', '$comments', '$discountcode')";

       

      mysqli_close($con);

      ?>

       

      Here is an image of the table in the database:

      Capture.JPG