syntax error, mariadb syntax |
syntax error, mariadb syntax |
srwright |
Sep 10 2014, 04:22 PM
Post
#1
|
Group: Members Posts: 2 Joined: 10-September 14 Member No.: 21,532 |
Hi all.
I have changed hosting providers. i have a contact form. which on form submit runs php code to add the message to the database. when i submit the form i get this error. "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 2" CODE <?php include 'db.php'; // Enter info into the Database. $message = htmlspecialchars($message); $sql = mysql_query("INSERT INTO mail (name, email, phone, message) VALUES('$name', '$email', '$phone', '$message',)") or die (mysql_error()); if(!$sql){ echo 'There has been an error sending your message. Please contact the webmaster.'; } else { //Mail us $emailcontent=" From: $name \n Phone: $phone \n Message: $message"; $recipient = "info@pcremedyservices.com"; $mailheader = "From: $email \r\n"; mail($recipient, $emailcontent, $mailheader) or die("Error!"); // Let's mail the user! $replysubject = "Your PC Remedy Services"; $replymessage = "Dear $name, This is an automated response from your local PC Remedy Services. Thank you for contacting us with your technical difficulties, A member of staff will get back to you as quickly as possible. Best regards PC Remedy Services Stephen Smith This is an automated response, please do not reply!"; mail($email, $replysubject, $replymessage, "From: info@pcremedyservices.com \r\n" . phpversion()); print '<script type="text/javascript">'; print 'alert("Your request for support has been mailed, please check your email for confirmation and replies. Please allow 12 hours for a reply.")'; print '</script>'; } ?> This is my send_mail script that is run when i submit the form. |
srwright |
Sep 10 2014, 04:42 PM
Post
#2
|
Group: Members Posts: 2 Joined: 10-September 14 Member No.: 21,532 |
sry all sorted it out..
stray comma lol |
Lo-Fi Version | Time is now: 23rd April 2024 - 06:20 AM |