I am having trouble inserting a list of towns into a database. The code reads from an Excel file and inserts the town name and a value that is looked up from another table.
The code for the insert statment is:
$insertPostcode[$i] = mysql_query("INSERT INTO probid_towns
(town, region_code) VALUES ('".$town."','".$exists['region_code']."')");
If the town name includes a ' symbol such as "Devil's Bridge" then the code brings up an error due to the extra '. Is there anyway to work round this or do I just have to remove the ' from my Excel file?