I use the following script to dump query result into another table. There was a problem.... records with "'" cannot be inserted into the second table. For example, Men's Tennis. How come? Is there anyway to solve this?


PHP Code:
$query mysql_query("select heading,Topic,FileCode,fk from table1");
while (
$row mysql_fetch_array($query)) { 
mysql_query("insert into table2(FileCode,heading,Topic,fk) values ('".$row['FileCode']."','".$row['heading']."','".$row[Topic]."','".$row['fk']."')");