Jump to content

Recommended Posts

Hello,

I'm having trouble with the code below. I have this exact same code on a different site with a different database and it works fine. I also have multiple tables within this database that are used for other sites and those are working fine as well. With this code, I get the "Error querying database" every time. I'm at a loss.

 

Variables:

$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$use = $_POST['use'];

 

Query (table name is jtm):

$query = "INSERT INTO jtm (firstname, lastname, phone, email, use) VALUES ('$firstname', '$lastname', '$phone', '$email', '$use') "; 

$result = mysqli_query($dbc, $query) or die('Error querying database');

Link to comment
https://forums.phpfreaks.com/topic/172023-solved-mysql-insert-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • 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.