Php to Workbench connection


Hello every one!
I used php environment and sql workbench i encountered Error:

INSERT INTO info (Lname, Mname, Birthday, birthplace) VALUES ('', '', '','')
Table 'test.info' doesn't exist. But the database connection is ok

Here some code

<?php
$host = "localhost";
$username = "root";
$password = "migs&daisy";
$dbname = "test";

// Create connection
$conn = mysqli_connect($host, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}

$sql = "INSERT INTO info (Lname, Mname, Birthday, birthplace)
VALUES ('$Lname', '$Mname', '$Birthday','$Birthplace')";

if (mysqli_query($conn, $sql)) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}

mysqli_close($conn);
?>
Can you move this to the Louge please as it isn't C/C++/C#.

i encountered Error: ... Table 'test.info' doesn't exist.
Maybe the error is Table 'test.info' doesn't exist and you're trying to insert into it.
Topic archived. No new replies allowed.