"; // This is the form that allows you to amend and test URLs. echo "

"; echo "URL
"; echo ""; echo "

"; // This is the table header - titles are set to be parameter names for easy reference echo "" ; echo ""; echo ""; // This while loop is the business end of this test program. It reads and processes the contents of the query results. while (($buffer = fgets($handle)) !== false) // read until end of file { $count += 1; // Increment counter by 1 $fields = explode("," ,$buffer); // expand the result set into an array - works for csv format only $framework = $fields[0]; // The next six lines show how to extract fields from the import line - csv format only $lot = $fields[1]; $supplier = $fields[2]; $customer = $fields[3]; $date = $fields[4]; $product = $fields[5]; $spend = $product[6]; $numfields = count($fields) ; // The number of fields returned echo $buffer."
"; // This will output the row unchanged except for a new line for each row. } echo "
frameworklotsuppliercustomerdate_from
date_to
productspend_from
spend_to
"; fclose($handle); } else {echo "error 1 - unable to open file";} ?>