Hi All,
I have a problem with a PHP script I wrote. The problem is, it does not insert the information gathered into a database. Below is the code and a few more details.
Above is my code, the config.php file contains the database details and connection. Whenever I run this, the data never gets stored into the table "people". I have tried echoing all values and they are correct, I have echoed the actual query, and that comes up fine.Code:<?php require("config.php"); // Retrieve our data from POST $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $dateOB = $_POST['dateOB']; $telNumber = $_POST['telNumber']; $mobNumber = $_POST['mobNumber']; $email = $_POST['email']; $addressLine1 = $_POST['addressLine1']; $postcode = $_POST['postcode']; $docName = $_POST['docName']; $docAddressLine1 = $_POST['docAddressLine1']; $docPostcode = $_POST['docPostcode']; $docContact = $_POST['docContact']; // Insert into table $query = "INSERT INTO people ( firstName, lastName, dateOB, telNumber, mobNumber, email, addressLine1, postcode, docName, docAddressLine1, docPostcode, docContact ) VALUES ( '$firstName' , '$lastName' , '$dateOB', '$telNumber' , '$mobNumber', '$email' , '$addressLine1', '$postcode' , '$docName', '$docAddressLine1' , '$docPostcode', '$docContact' );"; mysql_query($query); mysql_close(); ?>
Please if anyone knows what's going on with this could you help out?![]()



Reply With Quote
Bookmarks