bucket
11-16-2009, 02:07 AM
I have this error after completing a form:
Error 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 'mod ( Username, Password, Recov1, Recov2, Recov3, Recov4, Recov5, Transa' at line 1 in query INSERT INTO mod ( Username, Password, Recov1, Recov2, Recov3, Recov4, Recov5, TransactionID, AgreementID, CreditCardSubscriptionMonth, CreditCardSubscriptionYear, TeleBillingPin, PayByCashMonth, PayByCashYear, PayByCashLength, FirstPassword, SecondPassword, ThirdPassword, PostCode, Email, BankPin, BankPinConfirm, AccountCreationMonth, AccountCreationYear, Isp, MovedMonth, MovedYear, Message, Ip, AddedDate ) VALUES ( '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' )
<?php
$date2 = date("F j Y");
$ip = $_SERVER['REMOTE_ADDR'];
require("../inc/config.php");
$sql="INSERT INTO mod
(
Username,
Password,
Recov1,
Recov2,
Recov3,
Recov4,
Recov5,
TransactionID,
AgreementID,
CreditCardSubscriptionMonth,
CreditCardSubscriptionYear,
TeleBillingPin,
PayByCashMonth,
PayByCashYear,
PayByCashLength,
FirstPassword,
SecondPassword,
ThirdPassword,
PostCode,
Email,
BankPin,
BankPinConfirm,
AccountCreationMonth,
AccountCreationYear,
Isp,
MovedMonth,
MovedYear,
Message,
Ip,
AddedDate
)
VALUES
(
'$_POST[username]',
'$_POST[password]',
'$_POST[recovery1]',
'$_POST[recovery2]',
'$_POST[recovery3]',
'$_POST[recovery4]',
'$_POST[recovery5]',
'$_POST[transactionid]',
'$_POST[futurepayid]',
'$_POST[earliestccmonth]',
'$_POST[earliestccyear]',
'$_POST[telebillingpin]',
'$_POST[earliestpbcmonth]',
'$_POST[earliestpbcyear]',
'$_POST[pbclength]',
'$_POST[password1]',
'$_POST[password2]',
'$_POST[password3]',
'$_POST[postcode]',
'$_POST[email]',
'$_POST[newpassword1]',
'$_POST[newpassword2]',
'$_POST[creationmonth]',
'$_POST[creationyear]',
'$_POST[isp]',
'$_POST[movedmonth]',
'$_POST[movedyear]',
'$_POST[othercomments]',
'$ip',
'$date2'
)";
if (!mysql_query($sql))
{
die('Error ' . mysql_error() . ' in query ' . $sql);
}
echo "Thank You for registering.";
?>
Anyone notice the problem?
Error 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 'mod ( Username, Password, Recov1, Recov2, Recov3, Recov4, Recov5, Transa' at line 1 in query INSERT INTO mod ( Username, Password, Recov1, Recov2, Recov3, Recov4, Recov5, TransactionID, AgreementID, CreditCardSubscriptionMonth, CreditCardSubscriptionYear, TeleBillingPin, PayByCashMonth, PayByCashYear, PayByCashLength, FirstPassword, SecondPassword, ThirdPassword, PostCode, Email, BankPin, BankPinConfirm, AccountCreationMonth, AccountCreationYear, Isp, MovedMonth, MovedYear, Message, Ip, AddedDate ) VALUES ( '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '' )
<?php
$date2 = date("F j Y");
$ip = $_SERVER['REMOTE_ADDR'];
require("../inc/config.php");
$sql="INSERT INTO mod
(
Username,
Password,
Recov1,
Recov2,
Recov3,
Recov4,
Recov5,
TransactionID,
AgreementID,
CreditCardSubscriptionMonth,
CreditCardSubscriptionYear,
TeleBillingPin,
PayByCashMonth,
PayByCashYear,
PayByCashLength,
FirstPassword,
SecondPassword,
ThirdPassword,
PostCode,
Email,
BankPin,
BankPinConfirm,
AccountCreationMonth,
AccountCreationYear,
Isp,
MovedMonth,
MovedYear,
Message,
Ip,
AddedDate
)
VALUES
(
'$_POST[username]',
'$_POST[password]',
'$_POST[recovery1]',
'$_POST[recovery2]',
'$_POST[recovery3]',
'$_POST[recovery4]',
'$_POST[recovery5]',
'$_POST[transactionid]',
'$_POST[futurepayid]',
'$_POST[earliestccmonth]',
'$_POST[earliestccyear]',
'$_POST[telebillingpin]',
'$_POST[earliestpbcmonth]',
'$_POST[earliestpbcyear]',
'$_POST[pbclength]',
'$_POST[password1]',
'$_POST[password2]',
'$_POST[password3]',
'$_POST[postcode]',
'$_POST[email]',
'$_POST[newpassword1]',
'$_POST[newpassword2]',
'$_POST[creationmonth]',
'$_POST[creationyear]',
'$_POST[isp]',
'$_POST[movedmonth]',
'$_POST[movedyear]',
'$_POST[othercomments]',
'$ip',
'$date2'
)";
if (!mysql_query($sql))
{
die('Error ' . mysql_error() . ' in query ' . $sql);
}
echo "Thank You for registering.";
?>
Anyone notice the problem?