Jump to content

f701234

New Members
  • Posts

    2
  • Joined

  • Last visited

f701234's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. wow that was so easy, thanks a lot for the help
  2. Hi I am having an error in my code. What im trying to do is make a contact form where users input their information (Firstname, Lastname, PhoneNo, Email, and Message) then it gets sent to my database on phpmyadmin (called contactform) and their information should then show up on the table (contact-data) showing name, id, email address, the message etc. However the error im getting is this Fatal error: Uncaught mysqli_sql_exception: Unknown column 'message' in 'field list' in C:\xampp\htdocs\form\form-process.php:6 Stack trace: #0 C:\xampp\htdocs\form\form-process.php(6): mysqli->query('INSERT INTO `co...') #1 {main} thrown in C:\xampp\htdocs\form\form-process.php on line 6 and here is my code from the process.php and the config.php (which is supposed to connect to the database) Process - <?php include("config.php"); extract($_POST); $sql = "INSERT INTO `contact-data`(`firstname`, `lastname`, `phone`, `email`, `message`) VALUES ('".$firstname."','".$lastname."',".$phone.",'".$email."','".$message."')"; $result = $mysqli->query($sql); if(!$result){ echo "Couldn't enter data".$mysqli->error; } echo "Thank You For Contacting Us "; $mysqli->close(); ?> Confrig- <?php define("DB_HOST","localhost"); define("DB_USER","root"); define("DB_PASSWORD",""); define("DB_NAME","contactform"); $mysqli = new mysqli(DB_HOST,DB_USER, DB_PASSWORD,DB_NAME); ?>
×
×
  • 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.