Jump to content

Recommended Posts

i get this error message:

 

Error in query: INSERT INTO wbl_enquiryrespond (enquiry_id, login_id, enquiryreplydate, enquiryrespond) VALUES (''5 ', '9', '2009.08.15', 'tyjutyu'). You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5 ', '9', '2009.08.15', 'tyjutyu')' at line 1

 

<?php

session_start();

include '../../library/opendb.php';
include '../../library/config.php';
include '../../library/functions/f_login.php';
include '../../library/functions/f_nav.php';

sessionAuthenticate( );


$enquiryid = $_GET['id'];

$loginid = $_SESSION['login_id'];

$respond = $_POST['respond'];

$date = date("Y.m.d");

$query = "INSERT INTO wbl_enquiryrespond (enquiry_id, login_id, enquiryreplydate, enquiryrespond) VALUES (''$enquiryid ', '$loginid', '$date', '$respond')";

$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 


exit;

if (mysql_query ($query)) {
 $_SESSION["message"] = '<div class="message mb">Response To Enquiry Has Been Sent.</div>';
 header ('Location: list.php'); 
} 
else {
$_SESSION["message"] = '<div class="error mb">Response To Enquiry Failed.</div>';
header ('Location: list.php'); 
}

include '../../library/closedb.php';

?>

 

Please Help ! Thanks...

Link to comment
https://forums.phpfreaks.com/topic/170333-have-an-error-in-your-sql-syntax-help/
Share on other sites

taquitosensei is correct.

 

$query = "INSERT INTO wbl_enquiryrespond (enquiry_id, login_id, enquiryreplydate, enquiryrespond) VALUES (''$enquiryid ', '$loginid', '$date', '$respond')";

 

Change it to

$query = "INSERT INTO wbl_enquiryrespond (enquiry_id, login_id, enquiryreplydate, enquiryrespond) VALUES ('$enquiryid ', '$loginid', '$date', '$respond')";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.