|
|
|
update ข้อมลค่ะ เริ่มต้นยังไงดี เขียนมาถึงตรงนี้และก็ error ไปต่อไม่ได้ |
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<title></title>
</head>
<body>
<?
$strConn = new COM("ADODB.Connection") or die("Cannot start ADO");
$strConn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("database.mdb"));
$strSQL = "SELECT * FROM tbnews WHERE id = '".$_POST["id"]."' ";
//$objRec = $strConn->Execute($strSQL);
if(!$objRec->EOF)
{
echo("CustomerID already exist.");
}
else
{
$strSQL = "";
$strSQL .= "INSERT INTO tbnews ";
$strSQL .= "(id,subject,detail,picture,author,date) ";
$strSQL .= "VALUES ";
$strSQL .= "('".$_POST["id"]."','".$_POST["subject"]."','".$_POST["detail"]."' ";
$strSQL .= ",'".$_POST["picture"]."','".$_POST["author"]."','".$_POST["date"]."') ";
$flgSave = $strConn->Execute($strSQL);
If($flgSave)
{
echo("Save Done.");
}
else
{
echo("Error Save");
}
}
//$objRec->Close();
$strConn->Close();
$strConn = null;
?>
</body>
</html>
Tag : PHP, Ms Access
|
|
|
|
|
|
Date :
2011-12-06 17:31:59 |
By :
iibuu |
View :
798 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Error ที่ว่า มันบอกว่ายังไงครับ
|
|
|
|
|
Date :
2011-12-06 19:50:05 |
By :
mangkunzo |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
น่าจะ Path Error หรือ Database Read Only
|
|
|
|
|
Date :
2011-12-06 19:55:45 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|