I am just learning PHP and I have run into a little snag. I have my database all set up with the table that I need, but when I try to run it, i get the following error.
Fatal error: Call to undefined function mysqli_query() in /home/heights/public_html/test.php on line 108
This is my code:
<?php
$first_name = $_POST['firstname'];
$last_name = $_POST['lastname'];
$name = $_POST['firstname'] . ' ' . $_POST['lastname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$opsys = $_POST['opsys'];
$description = $_POST['description'];
$mailing = $_POST['mailing'];
$to= 'heightsdigital@gmail.com';
$msg = "$name\
" .
"
$email\
" .
"
$phone\
" .
"
$subject\
" .
"
$opsys\
" .
"
$description" . "
$mailing\
";
mail($to, $subject, $msg, 'From:' . $email);
if ($mailing == yes) {
$dbc = mysql_connect('localhost', 'heights', 'horizon9M','heights_digital')
or die ('Error connecting to MySQL Server!');
$query = "INSERT INTO mailing_list (first_name, last_name, email) " .
"VALUES ('$firstname','$lastname','$email')";
mysqli_query ($dbc, $query)
or die ('Error querying the database.');
mysql_close ($dbc);
}
echo 'Hello, ' . $first_name . '<br/>';
echo 'Thank you for contacting Heights Digital Services.<br />';
echo 'You can count on a reply to you within one business day!<br/>';
echo 'Click here to return to <a href="index.html">heightsdigital.com</a><br />';
?>
at first it was all mysqli but when i got the errors i started playing around with it.which is better? is this something i can fix or do i need contact the server admin?