Hey guys, I was just wondering if anyone could point out the mistake I'm making. Everything seems pretty okay to me but I ALWAYS get an error when the script try's to query the database. Sad. Any Ideas?
NOTE: I always get Oops! Error querying database.
//START---->GET THE DATA
$first = $_POST['firstname'];
$last = $_POST['lastname'];
$email = $_POST['emailaddress'];
//CONNECT TO DATA BASE
$dbc = mysqli_connect('address','user','pass','database');
echo "Connection successful..";
$q = "INSERT INTO email_list('first_name','last_name','email')" . "VALUES('$first', '$last', '$email')";
$result = mysqli_query($dbc, $q)
or die('Oops! Error querying database.');
echo "Data has been sent!";