任何重写....调试?什么都没有发生
这是导入的 php 代码,但是当我上传 CSV 时,我仍然...它根本没有...可能是什么错误!....任何专业知识?
<form enctype="multipart/form-data" action="" method="POST"> CSV:
<input name="file" type="file" /> <input type="submit" value="Upload
File" /></p> </form>
<?php
$connection = mysql_connect("51.63.225.22","mape","Leftie1982@")
or die ("Couldn't connect to server");
$db = mysql_select_db("mapsyracuse", $connection)
or die ("Couldn't select database");
if(isset($_POST['submit']))
{
$file = $_FILES['file']['tmp_name'];
$handle = fopen($file,"r");
while(($fileop = fgetcsv($handle,1000,",")) !== false)
{
$ID = $fileop[0];
$Teritory = $fileop[1];
$First_Name = $fileop[2];
$Last_Name = $fileop[3];
$Type = $fileop[4];
$Activity_Description = $fileop[5];
$Start_Date = $fileop[6];
$End_Date = $fileop[7];
$Duration = $fileop[8];
$Status = $fileop[9];
$sql = mysql_query("INSERT INTO account_manager(
ID,
Teritory,
First_Name,
Last_Name,
Type,
Activity_Description,
Start_Date,
End_Date,
Duration,
Status
)
VALUES(
'$ID',
'$Teritory',
'$First_Name',
'$Last_Name',
'$Type',
'$Activity_Description',
'$Start_Date',
'$End_Date',
'$Duration',
'$Status')");
}
if($sql)
{
echo 'CSV file successfully imported.';
}
}
?>
我现在添加哪个代码??????