I am importing data from csv into a temporary table...
The insert is working properly... all files are being imported into the users_working database....
however.... I am getting an undefined offset when I try to get a count of the files that were imported... any ideas what I have done wrong?
// get csv contents and build multi-value list insert query
while ($data = fgetcsv ($fp, 1000, ",")) {
$num = count ($data);
$first = $data[0];
$last= $data[1];
$valid = $data[7];
$sql1 = "INSERT INTO users_working (fName, lName, validation, datestamp, status) VALUES ('$first', '$last', '$valid', '$datestamp', '$status')";
$c0++;
// check file was not empty then insert data into work table
if ($c0 > 0){
$r1 = mysql_query($sql1, $importer)or die("<br>Error: ". mysql_error());
$c1 = mysql_affected_rows();
// get count of records inserted, part of hte string returned
$ary = explode(" ", $r1);
$c1 = $ary[1];
}
else{
echo ("Input file was empty");
}
}//end loop