class= " lineNumbers " do
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
|
class= do
id= " codeSnippet812889 " class= " do $csv_directory = opendir (“admin/csvfiles/");
$number_of_files = 0;
Quando ($filename = readdir ($csv_directory)) {
Se ($filename! = “.” && $filename! = “.” && $filename! = “_vti_cnf”) {
$local_file = “admin/csvfiles/”. $filename;
$fp = fopen (“$local_file”, “r”);
quando ($data = fgetcsv ($fp, 1000, “, ")) {
$import= " INSERÇÃO em entregas AVALIA ('', “$data [0]”, “$data [1]”, “$data [2]”, “$data [3]”, “$data [4]”, “$data [5]”, “$data [6]”, “$data [7]”, “$data [8]”, “$data [9]”, “$data [10]”, “$data [11]”, “$data [12]”, “$data [13]”, “$data [14]”, “$data [15]”, “$data [16]”, “$data [17]”, “$data [18]”, “$data [19]”, “$data [20]”, “$data [21]”, “$data [22]”, “$data [23] ") “;
o mysql_query ($import) ou morre (o mysql_error ());
}
unlink ($local_file);
fclose ($fp);
$number_of_files++;
}
}
|