我是新手。我試圖添加頭文件到csv從sqlite3數據庫提取數據,但沒有運氣。任何幫助,將不勝感激。使用php從sqlite3添加頭文件到csv
<?php
$db = new sqlite3('I:\webbs.db');
$results = $db->query('select Id ,CompanyId ,DateTime ,Serial ,DeviceId ,AgentAId ,GpsAddress ,Targa ,CommonRoadDescription ,RoadCivicNumber ,VehicleBrandDescription
,VehicleModelDescription ,VerbaliVehicleTypeDescription ,CommonColorVehicleDescription ,VerbaliRuleOneCode ,VerbaliRuleOneDescription ,VerbaliRuleOnePoints ,VerbaliClosedNoteDescription
,Points ,VerbaliMissedNotificationDescription ,MissedNotificationNote ,StatementNote from VerbaliData');
$fp = fopen('explorer.csv', 'w');
while ($row = $results->fetchArray(SQLITE3_BOTH)) {
fputcsv($fp, $row);
}
fclose($fp);
?>
好地方是在你的代碼中的'headers'? –
嗨Shankar,查詢... sql select statment是標題right.can你幫我吧..我沒有得到它。 – preethi