เรียกข้อมูลเข้ามาในphpMy admin ไม่ได้อ่ะ ช่วยตอบทีนะคะว่าทำไมเรียกเข้ามาไม่ได้
ช่วยตอบทีนะคะว่าทำไมเรียกเข้ามาไม่ได้
<html>
<head>
<title>ThaiCreate.Com PHP(COM) Excel.Application Tutorial</title>
</head>
<body>
<?
//*** Get Document Path ***//
$strPath = realpath(basename(getenv($_SERVER["ppp"]))); // C:/AppServ/www/myphp
$OpenFile = "MyXls/hyi-access";
//*** Create Exce.Application ***//
$xlApp = new COM("Excel.Application");
$xlBook = $xlApp->Workbooks->Open($strPath."/".$OpenFile);
$xlSheet1 = $xlBook->Worksheets(1);
//*** Insert to MySQL Database ***//
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("sever");
for($i=2;$i<=7;$i++){
If(trim($xlSheet1->Cells->Item($i,1)) != "")
{
$strSQL = "";
$strSQL .= "INSERT INTO hyi-access";
$strSQL .= "(Module,Name,จำนวนPort,Portที่ใช้งาน,ต่อไปที่,IP Address)";
$strSQL .= "VALUES";
$strSQL .= "('".$xlSheet1->Cells->Item($i,1)."','".$xlSheet1->Cells->Item($i,2)."' ";
$strSQL .= ",'".$xlSheet1->Cells->Item($i,3)."','".$xlSheet1->Cells->Item($i,4)."' ";
$strSQL .= ",'".$xlSheet1->Cells->Item($i,5)."','".$xlSheet1->Cells->Item($i,6)."') ";
//$strSQL .= ",'".$xlSheet1->Cells->Item($i,7)."','".$xlSheet1->Cells->Item($i,8)."') ";
//$strSQL .= ",'".$xlSheet1->Cells->Item($i,9)."','".$xlSheet1->Cells->Item($i,10)."') ";
mysql_query($strSQL);
}
}
//*** Close MySQL ***//
@mysql_close($objConnect);Tag : - - - -
Date :
2009-04-27 15:13:30
By :
patzyja
View :
989
Reply :
2
Load balance : Server 03