0
當我有這個php
功能:資源ID#13試圖查詢結果導出爲CSV
function get_download($dbmi, $getid) {
$stmt = $dbmi->prepare("CALL spStartDownload(?)");
$stmt->bind_param('i', $getid);
$stmt->execute();
$result = $stmt->get_result();
$fp = fopen('file.csv', 'w');
while($row = $result->fetch_assoc()) {
fputcsv($fp, $row);
}
fclose($fp);
$stmt->close();
echo $fp;
}
我想不通爲什麼它給我的資源ID#13錯誤。
任何幫助,非常感謝。