I am trying to insert some values in to mysql database via php code. It is straight forward, but it is not working. Here is my code:
$first = $_POST['first'];
$last = $_POST['last'];
$address = $_POST['address'];
$mjesto = $_POST['mjesto'];
$ptt = $_POST['ptt'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$a=1;
$conn = new mysqli('server', 'user', 'pass', 'db');
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "insert into imtecEvents values
('".$a."', '".$first."', '".$last."', '".$address."', '".$mjesto."', '".$ptt."', '".$email."', '".$phone."', '".$a."' )";
$conn->query($sql);