[thelist] [PHP].csv file upload weirdness
Jay Blanchard
jay.blanchard at niicommunications.com
Wed Dec 10 05:29:31 CST 2003
[snip]
Hello there (thanks to all those who helped with the site check earlier
this week)
I have a script to load a .csv file to populate a database. The sql
statement barfed at having single quotes in the file , so I removed them
and re-uploaded the file.
Trouble is, I get the same sql error, on the same line, even though
*all* single quotes have been removed from the file. Even renaming the
file and uploading it gives the same error. It is like the old file is
cached in the tmp directory and being processed instead of the new one.
I have checked for stray single quotes in Excel and Homesite and found
not a one.
Any ideas on how I can avoid this? Can I clear the tmp directory using
php?
[/snip]
Can we see the line that makes it barf? Also, you shouldn't have to
remove the single quotes if you are using PHP. You can use addslashes()
to escape the single quotes or htmlentities() to change the single
quotes to their respective HTML counterpart. The upload should not be
cached.
More information about the thelist
mailing list