Jump to content

Will not ADD


Kniggles

Recommended Posts

Hi i have been trying to work out why this code will not add the data to the base,

any pointer please?

thanks in-advance. :)

<?php

// Database connection establishment
    $con=mysqli_connect("localhost","Deric","Password,"players");
    
// Check connection
    if (mysqli_connect_errno($con)) {
        echo "MySQL database connection failed: " . mysqli_connect_error();
    }

//CHECKING SUBMIT BUTTON PRESS or NOT.
echo "successfull here ";
    if(isset($_POST["submitBtn"]) && $_POST["submitBtn"]!=""){ 
        $name=$_POST["name"];
        $email=$_POST["email"];
        $message=$_POST["message"];

echo "$name";
echo "$email";
echo "$message";
echo "working ** ";
//INSERT QUERY
    if(mysqli_query("INSERT INTO contact (name, email, message)
        VALUES ($name, $email, $message)")){
        echo "Record inserted successfully";
    }}


?>

 

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...