class= " lineNumbers " del
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
|
class= del
id= " codeSnippet812889 " class= " del $csv_directory = opendir (“admin/csvfiles/");
$number_of_files = 0;
Mentre ($filename = readdir ($csv_directory)) {
Se ($filename! = “.„ && $filename! = “.„ && $filename! = “_vti_cnf„) {
$local_file = “admin/csvfiles/„. $filename;
$fp = fopen ("$local_file„, “la r„);
mentre ($data = fgetcsv ($fp, 1000, “, ")) {
$import= " INSERTO nelle consegne STIMA ('', “$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] ") “;
il mysql_query ($import) o muore (mysql_error ());
}
sconnettere ($local_file);
fclose ($fp);
$number_of_files++;
}
}
|