\n\n";
}
// compare function
function cmpi($a, $b)
{
global $sort_field;
return strcmp($a[EventStartDate], $b[EventStartDate]);
}
/*
//ADO Version for PHP5 only
// Set the query we'll be using on the file.
$adoQuery = "SELECT * from " . $csvFile;
// Create the ADO connection and ADO recordset
$adoConn = new COM("ADODB.Connection") or die("Can't start ADO");
$recordSet = new COM("ADODB.RecordSet") or die("Can't create record set");
// Open the connection and set parameters for the query
$adoConn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" . $csvPath . ";Extended Properties=\"text;HDR=YES;FMT=Delimited\"");
// Execute the query against the connection (results are stored in the recordset!)
$recordSet->Open($adoQuery, $adoConn);
// Count the number of field returned in the recordset (allows us to iterate through)
$intFieldCount = $recordSet->Fields->Count;
// Tabularise the data returned
echo '
'."\n\t
Record No.
\n"; // I have included a TH for a record count field too!
for ($i=0; $i< $intFieldCount; $i++) {
echo "\t
".ucfirst($recordSet->Fields[$i]->Name).""."\n";
}
$j = 1; // Set a counter to show record numbers in the record count field.
while (!$recordSet->EOF) {
echo "\t".'
'."\n\t\t
$j
\n";
for ($i=0; $i< $intFieldCount; $i++) {
echo "\t\t