Hello, I am getting this error after submitting a registration form I have created.
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 ') VALUES ('','','','','','','','N', '00','00.000','W','000','00.000')' at line 1
Maybe I just need fresh eyes or something. Could someone look it over and tell me if you see anything wrong. I have gone over it but I can't see anything.
<?
include("dbinfo.inc.php");
$str_first = $_POST['first'];
$str_first = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_first);
$str_last = $_POST['last'];
$str_last = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_last);
$str_email = $_POST['email'];
$str_email = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_email);
$str_username = $_POST['username'];
$str_username = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_username);
$str_password = $_POST['password'];
$str_password = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_password);
$str_city = $_POST['city'];
$str_city = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_city);
$str_zipcode = $_POST['zipcode'];
$str_zipcode = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_zipcode);
$str_cordv = $_POST['cordv'];
$str_cordv = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_cordv);
$str_lat1 = $_POST['lat1'];
$str_lat1 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_lat1);
$str_lat2 = $_POST['lat2'];
$str_lat2 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_lat2);
$str_cordh = $_POST['cordh'];
$str_cordh = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_cordh);
$str_long1 = $_POST['long1'];
$str_long1 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_long1);
$str_long2 = $_POST['long2'];
$str_long2 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_long2);
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = mysql_query("INSERT INTO accounts (first, last, email, username, password, city, zipcode, cordv, lat1, lat2, cordh, long1, long2,)
VALUES ('$str_first','$str_last','$str_email','$str_username','$str_password','$str_city','$str_zipcode','$str_cordv',
'$str_lat1','$str_lat2','$str_cordh','$str_long1','$str_long2')")or die (mysql_error());
mysql_close();
?>
Thanks for the help.