Wrong PHP code?
Posted: Tue Nov 15, 2011 6:02 am
[text]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,Ads,On,Accepted,Sched,Location) VALUES ('xxxxxxxxxxx@xxxxxxxxxxx.xxx','xxxxxxxxxx' at line 1[/text]
:yawn: can anyone tell me what is wrong? i think , codes are not wrong.
Thanks.
Code: Select all
<?php
session_start();
session_destroy();
$con = mysql_connect("xxxxxxxxxxxxxxxxxxx.xxxxxxxxx.xxx","xxxxxx_accounts","xxxxxxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxxxxxxxxx_accounts", $con);
$sql="INSERT INTO Account (EmailAdd,Password,Name,DJ,Mod,Ads,On,Accepted,Sched,Location)
VALUES
('$_POST[Emailadd]','$_POST[Password]','$_POST[Name]','$_POST[DJ]','None','None','no','no','None','$_POST[Location]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
header('Location: http://xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxx.xxx/index.html');
mysql_close($con)
?> Thanks.