err.. sql error
Posted: Thu Aug 18, 2005 4:00 pm
Seems like I am having all kinds of troubles with my zip code script.
Result:
Where's this error coming from?
Code: Select all
$zip = $buffer3[0];
$lat = $buffer3[1];
$long = $buffer3[2];
$city = $buffer3[3];
$state = $buffer3[4];
$county = $buffer3[5];
$type = $buffer3[6];
$SQL = "INSERT INTO location(zip,lat,long,city,state,county,type) VALUES('$zip','$lat','$long','$city','$state','$county','$type')";
echo $SQL."<BR>";
mysql_query("INSERT INTO location(zip,lat,long,city,state,county,type) VALUES('$zip','$lat','$long','$city','$state','$county','$type')") or die(mysql_error());Code: Select all
INSERT INTO location(zip,lat,long,city,state,county,type) VALUES('00501','+40.922326','-072.637078','HOLTSVILLE','NY','SUFFOLK','UNIQUE ')
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 'long,city,state,county,type) VALUES('00501','+40.922326','-072.637078','HOLTSVIL' at line 1