Jump to content

mysqlli insert query...not working, no errors


atticus

Recommended Posts

I have verified all connection and table data is connect. I typically do not use mysqlli. What am I doing wrong:

 

<?php 
error_reporting(E_ALL);
ini_set('display_errors', '1');

$id = $_POST['id'];
$name = $_POST['Name'];
$email = $_POST['Email'];
$phone = $_POST['Phone'];
$city = $_POST['City'];

echo $name;


////// Connect to DB
$mysqli = new mysqli("db", "user", "pass", "db");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

$query = "INSERT INTO person(name,email,phone,city) VALUES ('$name','$email','$phone','$city') WHERE person_id = $id" or die('Could not connect: ' . mysql_error());
$mysqli->query($query);

?>

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.