$dbc=mysql_connect('127.0.0.1', 'root', '1234','aliendatabase')
or die('Failed!');
$query = "INSERT INTO alien_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')";
$result=mysql_query($query)
or die("Failed to upload!!!!");
mysql_close($dbc);
This code is unable to execute $result line (so outputs Failed to upload!!!!) but it is able to establish connection. I have cross-checked the table column name and variables and it seems fine.
MySQL version 5.7