I have recently written a php script to load csv files into a database which was all working fine until I noticed that LOAD DATA is loading the file twice, even if a specify a single csv file is loads the data into the table twice. Any help would be appreciated as it's been driving me nuts for the last six hours. Thanks in advance.
You are calling "LOAD DATA" from your PHP script, right? Have in mind that LOAD DATA in MySQL loads the file EXACTLY one time. This means that you are calling it twice. Put some debug echo echo "Calling LOAD DATA..."; mysql_query("LOAD DATA... and debug your script.
Thanks for reply. WHen I put the echo statement in I only get one instance of it, so I can't see/how or why it runs twice. I get no errors with mysql_query. It is a php script.. Very confusing this one.
Fixed it, stupidity on my part, I was using mysql_query($query) to runthe query and then error checking with if(mysql_query($query)) hence it was putting it in twice. Thanks