$name = $_POST["name"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zipcode = $_POST["zipcode"];
$country = $_POST["country"];
$month = $_POST["month"];
$day = $_POST["day"];
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO birthdays (name, address, city, state, zipcode, country, month, day)
VALUES ($_POST["name"], $_POST["address"], $_POST["city"], $_POST["state"], $_POST["zipcode"], $_POST["country"], $_POST["month"], $_POST["day"])";
if ($conn->query($sql) === TRUE) {
echo "You have been added to the birthday list";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
does the database prefix need to be included in the login/database? i'm confused right now.
sacrmfuw_sjay
is with the prefix.. sjay
is without it