stevenvh
08-19-2009, 10:25 AM
Hi,
I want to write data from a textfile to a mysql table. The following code works for the first few records, but then fails.
$query = "INSERT INTO mytable (id, title, page ) VALUES ('$i', '$title', '$page')";
mysql_query($query) or die('Error, query failed');
It appears that in the 'title' field of the incriminating record there's a single quote, which I presume to be the culprit. How can I make the query swallow the sql statement?
I guess double quotes will be no good, as they also appear in the record.
TIA
Steven
I want to write data from a textfile to a mysql table. The following code works for the first few records, but then fails.
$query = "INSERT INTO mytable (id, title, page ) VALUES ('$i', '$title', '$page')";
mysql_query($query) or die('Error, query failed');
It appears that in the 'title' field of the incriminating record there's a single quote, which I presume to be the culprit. How can I make the query swallow the sql statement?
I guess double quotes will be no good, as they also appear in the record.
TIA
Steven