OK, here's what I've got so far:
<table class="tftable" border="1">
<tr><th>Header 1</th><th>Header 2</th><th>Header 3</th><th>Header 4</th><th>Header 5</th><th>Header 6</th><th>Header 7</th></tr>
<?php
define('CSV_PATH','/Applications/XAMPP/xamppfiles/htdocs/SITEPREVIEW/csv_file_drop_folder/');
$csv_file = CSV_PATH . "test.csv";
if(($handle=fopen($csv_file,"r"))!== FALSE){
fgetcsv($handle);
while(($data=fgetcsv($handle,1000,","))!==FALSE){
$num = count($data);
for($c=0;$c<$num;$c++){
$col[$c]=$data[$c];
}
$col1=$col[0];
$col2=$col[1];
$col3=$col[2];
$col4=$col[3];
$col5=$col[4];
$col6=$col[5];
$col7=$col[6];
echo "<tr><th>".$col1."</th><th>".$col2."</th><th>".$col3."</th><th>".$col4."</th><th>".$col5."</th><th>".$col6."</th><th>".$col7."</th></tr>";
}
fclose($handle);
}
?>
</table>
So I run this and ($data=fgetcsv($handle,1000,","))
is coming out FALSE
I think, but not sure why, and so only the headers get printed to the page.
Got rid of fgetcsv($handle);
, but only prints one line, and I checked the file contents of my .csv
file and this is what I have: