Jump to content

[SOLVED] MySQL Insert Help


jmekelb

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

Archived

This topic is now archived and is closed to further replies.

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