<?php
include 'connectdb.php';
$row = 1;
if (($handle = fopen("test.csv", "r" )) !== FALSE) {
while (($data = fgetcsv($handle, 1000, "," )) !== FALSE) {
$num = count($data);
echo "<p> $num champs à la ligne $row: <br /></p>\n";
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";
/*$sql= "INSERT INTO test VALUES('','".$data[$c]."')";
$sql_query = mysqli_query($conn, $sql);*/
}
}
fclose($handle);
}
?> |