-1
我試圖導入CSV的多行到SQL,並且此代碼僅使用少量行數(例如75行)導入,它會成功,但是當我試圖在SQL中導入多行數據(例如700000行)時,會出現。導入大尺寸的CSV到SQL得到了這個警告:fopen():文件名不能爲空
if(($handle = fopen($_FILES['file']['tmp_name'], 'r')) !== false)
{
$header = fgetcsv($handle);
while(($data = fgetcsv($handle)) !== false){
$sql = "INSERT into mansfield_barcode.dbo.".$_POST['uploadSName']." values('".implode("','", $data)."')";
$result = mssql_query($sql);
unset($data);
if(! $result){
echo "<script type=\"text/javascript\">
alert(\"Invalid File:Please Upload CSV File.\");
window.location = \"sku.php\"
</script>";
}
}
fclose($handle);
echo "<script type=\"text/javascript\">
alert(\"CSV File has been successfully Imported.\");
window.location = \"sku.php\"
</script>";
}
檢查您的php.ini文件的upload_tmp_dirpost_max_size以及upload_max_filesize的值。 – JDpawar