CSV import help
Posted: Mon Aug 04, 2008 1:02 am
Hello
New to php but making progress. I have a csv file i am importing with:
one field is a persons Name and chugs along until it finds the name D'arcy or anything with a " or ' and throws an error
What would be a good way to deal with this?
Thanks in advance
New to php but making progress. I have a csv file i am importing with:
Code: Select all
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
$row++;
$import = ("INSERT INTO foobar
(
foo ,
Name ,
bar
)
values
(
'$data[0]' ,
'$data[1]',
'$data[2]'
)
");
What would be a good way to deal with this?
Thanks in advance