|
|
|
ผมทำการ Insert ข้อมูลลง SQL SERVERไม่ได้อ่ะครับโดยใช้ php มันขึ้น Error อ่ะครับรบกวนผู้รู้ดูให้ทีครับ |
|
|
|
|
|
|
|
Code
Error Save [INSERT INTO Promotion (PromType_ID,PromMType_ID,Owner_ID,Marketing_ID,RequestFlag,PromMaster_ID ,ReasonType_ID,Prom_MasterName,Prom_Name,Prom_Desc,SDate,EDate,STime,ETime, Status,ShowReportStatus,ForMatSearch,ISUpdate_UsedDate,ShowNoRole,BottomComment ,UsedComment,Check_AlertJackpot,Alert_Jackpot,Alert_None,Alert_OverQuota, Check_ShowUsedDataKey,JavascriptKeyWhenSearchKey,CheckSubstringWhenSearchKey, CheckCanKeyWhenSearchKey,CheckBranchWhenSearchKey,CheckLenghtSubstringWhenProcess, CheckMovieIDWhenInputLog,CheckMinSeatWhenInputLog,CheckMaxSeatWhenInputLog, CheckPromiseProductCodeWhenInputLog, CheckPromisePriceGroupIDWhenInputLog,AllUseTimesMax,AllUseSeatMax,AllUsePointMax, CheckTransBranchLimit,CheckTransUseTimesMax,CheckTransUseSeatMax,CheckTransUsePointMax, CheckUseTimesMax,CheckUseSeatMax,CheckUsePointMax,Default_UseTimesMax,Default_UseSeatMax, Default_UsePointMax,UseTimesPerMonth,UseTimesPerWeek,UseTimesPerDay,UseTimesAndBlockCountDay, UseSeatPerMonth,UseSeatPerWeek,UseSeatPerDay,Start_ID,Start_Value,Expired_ID,Expired_Value, ImportF_ID,ImportF_QTY_FileName,ImportF_QTY_FieldH,ImportF_QTY_FieldD,ImportF_QTy_FieldF, OrderBy,PromUser_ID,AdjustPointStatus,UpdateDate,CreateDate)
VALUES ('1','','8' ,'3','True','sfdsfdsfdsfsdf' ,'
','sfdfadsfsdf','sadfasfd' ,'safdasd','dsadsasa','dasdasdas','524','464','True' ,'True','1','' ,'True','4545456','45' ,'False','464','��辺������' ,'6dwde','True','wd' ,'lm;','True','True' ,';lj','True','j;lj' ,';ljm','Null','Null' ,'lm','lml','' ,'True','True','True' ,'True','True','True' ,'True','n','l\';' ,'m\';\',l\';','l;','' ,';k',';k;',';,/' ,',','\'.j;ljkkk','k' ,'kk','kkk','' ,'kk','','kk' ,'','','' ,'','','' ,'','','' ,'') ]
อันนี้codeนะครับ
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$objConnect = mssql_connect("mjccpc01","ceo","") or die("Error Connect to Database");
$objDB = mssql_select_db("PromotionForSeat");
$strSQL = "INSERT INTO Promotion ";
$strSQL .="(PromType_ID,PromMType_ID,Owner_ID,Marketing_ID,RequestFlag,PromMaster_ID,ReasonType_ID, Prom_MasterName,Prom_Name,Prom_Desc,SDate,EDate,STime,ETime,Status,ShowReportStatus, ForMatSearch,ISUpdate_UsedDate,ShowNoRole,BottomComment,UsedComment,Check_AlertJackpot, Alert_Jackpot,Alert_None,Alert_OverQuota,Check_ShowUsedDataKey,JavascriptKeyWhenSearchKey, CheckSubstringWhenSearchKey,CheckCanKeyWhenSearchKey,CheckBranchWhenSearchKey, CheckLenghtSubstringWhenProcess,CheckMovieIDWhenInputLog,CheckMinSeatWhenInputLog ,CheckMaxSeatWhenInputLog,CheckPromiseProductCodeWhenInputLog,CheckPromisePriceGroupIDWhenInputLog, AllUseTimesMax,AllUseSeatMax,AllUsePointMax,CheckTransBranchLimit,CheckTransUseTimesMax, CheckTransUseSeatMax,CheckTransUsePointMax,CheckUseTimesMax,CheckUseSeatMax,CheckUsePointMax, Default_UseTimesMax,Default_UseSeatMax,Default_UsePointMax,UseTimesPerMonth,UseTimesPerWeek, UseTimesPerDay,UseTimesAndBlockCountDay,UseSeatPerMonth,UseSeatPerWeek,UseSeatPerDay,Start_ID, Start_Value,Expired_ID,Expired_Value,ImportF_ID,ImportF_QTY_FileName,ImportF_QTY_FieldH,ImportF_QTY_FieldD ,ImportF_QTy_FieldF,OrderBy,PromUser_ID,AdjustPointStatus,UpdateDate,CreateDate) ";
$strSQL .="VALUES ";
$strSQL .="('".$_POST["PromType_ID"]."','".$_POST["PromMType_ID"]."','".$_POST["Owner_ID"]."' ";
$strSQL .=",'".$_POST["Marketing_ID"]."','".$_POST["RequestFlag"]."','".$_POST["PromMaster_ID"]."' ";
$strSQL .=",'".$_POST["ReasonType_ID"]."','".$_POST["Prom_MasterName"]."','".$_POST["Prom_Name"]."' ";
$strSQL .=",'".$_POST["Prom_Desc"]."','".$_POST["SDate"]."','".$_POST["EDate"]."','".$_POST["STime"]."','".$_POST["ETime"]."','".$_POST["Status"]."' ";
$strSQL .=",'".$_POST["ShowReportStatus"]."','".$_POST["ForMatSearch"]."','".$_POST["ISUpdate_UsedDate"]."' ";
$strSQL .=",'".$_POST["ShowNoRole"]."','".$_POST["BottomComment"]."','".$_POST["UsedComment"]."' ";
$strSQL .=",'".$_POST["Check_AlertJackpot"]."','".$_POST["Alert_Jackpot"]."','".$_POST["Alert_None"]."' ";
$strSQL .=",'".$_POST["Alert_OverQuota"]."','".$_POST["Check_ShowUsedDataKey"]."','".$_POST["JavascriptKeyWhenSearchKey"]."' ";
$strSQL .=",'".$_POST["CheckSubstringWhenSearchKey"]."','".$_POST["CheckCanKeyWhenSearchKey"]."','".$_POST["CheckBranchWhenSearchKey"]."' ";
$strSQL .=",'".$_POST["CheckLenghtSubstringWhenProcess"]."','".$_POST["CheckMovieIDWhenInputLog"]."','".$_POST["CheckMinSeatWhenInputLog"]."' ";
$strSQL .=",'".$_POST["CheckMaxSeatWhenInputLog"]."','".$_POST["CheckPromiseProductCodeWhenInputLog"]."','".$_POST["CheckPromisePriceGroupIDWhenInputLog"]."' ";
$strSQL .=",'".$_POST["AllUseTimesMax"]."','".$_POST["AllUseSeatMax"]."','".$_POST["AllUsePointMax"]."' ";
$strSQL .=",'".$_POST["CheckTransBranchLimit"]."','".$_POST["CheckTransUseTimesMax"]."','".$_POST["CheckTransUseSeatMax"]."' ";
$strSQL .=",'".$_POST["CheckTransUsePointMax"]."','".$_POST["CheckUseTimesMax"]."','".$_POST["CheckUseSeatMax"]."' ";
$strSQL .=",'".$_POST["CheckUsePointMax"]."','".$_POST["Default_UseTimesMax"]."','".$_POST["Default_UseSeatMax"]."' ";
$strSQL .=",'".$_POST["Default_UsePointMax"]."','".$_POST["UseTimesPerMonth"]."','".$_POST["UseTimesPerWeek"]."' ";
$strSQL .=",'".$_POST["UseTimesPerDay"]."','".$_POST["UseTimesAndBlockCountDay"]."','".$_POST["UseSeatPerMonth"]."' ";
$strSQL .=",'".$_POST["UseSeatPerWeek"]."','".$_POST["UseSeatPerDay"]."','".$_POST["UsePointPerMonth"]."' ";
$strSQL .=",'".$_POST["UsePointPerWeek"]."','".$_POST["UsePointPerDay"]."','".$_POST["Start_ID"]."' ";
$strSQL .=",'".$_POST["Start_Value"]."','".$_POST["Expired_ID"]."','".$_POST["Expired_Value"]."' ";
$strSQL .=",'".$_POST["ImportF_ID"]."','".$_POST["ImportF_QTY_FileName"]."','".$_POST["ImportF_QTY_FieldH"]."' ";
$strSQL .=",'".$_POST["ImportF_QTY_FieldD"]."','".$_POST["ImportF_QTy_FieldF"]."','".$_POST["OrderBy"]."' ";
$strSQL .=",'".$_POST["PromUser_ID"]."','".$_POST["AdjustPointStatus"]."','".$_POST["UpdateDate"]."' ";
$strSQL .=",'".$_POST["CreateDate"]."') ";
if($objQuery)
{
echo"<script>alert('เพิ่มข้อมูลเสร็จเรียบร้อย');window.location='ui.php';</script>";
}
else
{
echo "Error Save [".$strSQL."]";
}
mssql_close($objConnect);
?>
</body>
</html>
---------------------------------------------------ขอบคุนล่วงหน้าครับ^^
Tag : PHP, Ms SQL Server 2005
|
|
|
|
|
|
Date :
2011-12-20 14:51:25 |
By :
maxnoilnw |
View :
896 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mssql_query() ของคุณหายไปไหนครับ
Code (PHP)
if(mssql_query($strSQL))
{
echo"<script>alert('เพิ่มข้อมูลเสร็จเรียบร้อย');window.location='ui.php';</script>";
}
else
{
echo "Error Save [".mssql_error()."]";
}
mssql_close($objConnect);
|
|
|
|
|
Date :
2011-12-20 16:10:28 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|