Мой код:
<?php
if (isset($_POST['inquiries'])) {
$host = "localhost";
$username = "root";
$password = "";
$database = "Owl"; //also added semi colon and what database name
$conn = mysqli_connect($host, $username, $password, $database);
if (mysqli_connect_errno($conn)) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$name = mysqli_real_escape_string($conn,$_POST['name']); //I've added $conn inside mysqli_real_escape_string expected 1st param
$surname = mysqli_real_escape_string($conn,$_POST['surname']);
$number = mysqli_real_escape_string($conn,$_POST['number']);
$email = mysqli_real_escape_string($conn,$_POST['email']);
$date = date("Y-m-d");
$password = md5($password);
$sql = "INSERT INTO users (name, surname, number, email, sign_up_date) VALUES ('$name', '$surname', '$number', '$email', '$date')";
$query = mysqli_query($conn, $sql); // I think this will add data in your database.
if (!$conn) { //I change this from mysql_query($sql)
die('Error: ' .mysqli_error());
} else {
echo "Entry added successfully";
mysqli_close($conn);
}
}
?>
Колонки в phpmyAdmin: