I started to learn PHP and MySql from Head First and now i'm in chapter 2 and i'm doing some exercises from book.
$connection = mysql_connect("127.0.0.1", "root", "", "aliendatabase")
or die ("Oops! Couldn't connect to server because ". mysql_error());
$sql="INSERT INTO aliens_abduction (first_name, last_name, when_it_happened, how_long, how_many, alien_description, what_they_did, fang_spotted, other, email)
VALUES ('$first_name', '$last_name', '$when_it_happened', '$how_long', 'how_many', '$alien_description', '$what_they_did', '$fang_spotted', '$other', '$email')";
mysqli_query($connection, $sql)
or die('Error querying database.' . mysql_error());
mysqli_close($connection);
While i was writing that part, i keep getting "Error querying database" error. Can anyone show me what's wrong in this code?