I have this code to import a csv file into mysql:
What I need is to be able to select a LOCAL file, have it uploaded to a temp directory and imported into mysql, all from a web page. I don't dare turn this loose with myadmin, as the users will be nubes of the most extreme!
$handle = fopen("$filename", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
$import="INSERT into table1(test1,test2,test3) values('$data','$data','$data')";
mysql_query($import) or die(mysql_error());
print "Import done";
print "<form action='csv_importer.php' method='post'>";
print "Type file name to import:<br>";
print "<input type='file' name='filename' size='20'><br>";
print "<input type='submit' name='submit' value='submit'></form>";
Anyway, is there a simple way to get what I have working?