Jump to content
Sign in to follow this  

Will not ADD

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. :)


// Database connection establishment
// Check connection
    if (mysqli_connect_errno($con)) {
        echo "MySQL database connection failed: " . mysqli_connect_error();

echo "successfull here ";
    if(isset($_POST["submitBtn"]) && $_POST["submitBtn"]!=""){ 

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



Share this post

Link to post
Share on other sites

You might be missing a quote mark in your $con line.

What output are you getting? Any errors?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...