|
|
|
Error Save [INSERT INTO resume ( Res_IDPersonnel, Res_Prefix, Res_Names, Res_lastname, Res_Names_Eng, Res_Ldentitycode, Res_Blood, Res_NickName, Res_S |
|
|
|
|
|
|
|
พอ บันทึกแล้วมันขึ้น มีวิธีแก้ป่าวครับ มือใหม๋ ครับ
Code
Error Save [INSERT INTO resume ( Res_IDPersonnel, Res_Prefix, Res_Names, Res_lastname, Res_Names_Eng, Res_Ldentitycode, Res_Blood, Res_NickName, Res_Sex, Res_Tel, Res_Email, Res_Birthday, Res_Address, Dis_DistrictID, Res_PostalCode, Bel_BelongID, Res_Duty, Res_DayOperations, Res_Salary, Bos_BossID, Res_IDTheDriver, Res_Educational, Res_Emergency, Res_Father, Res_TelFather, Res_Mather, Res_TelMather, Vac_VacationID, Lae_LaeveID, Rig_RightID, Group, Cal_ID) VALUES ('','','' ,'','','' ,'','','' ,'','','' ,'','','' ,'','','' ,'','','' ,'','','' ,'','','' ,'','','' ,'','') ]
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2012-11-11 19:21:33 |
By :
Nom |
View :
893 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
มันบันทึกไม่ลง ฐานข้อมูล น่ะครับ เอาโค้ดมาลงดีกว่าครับ จะได้ช่วยแก้ไขถูก
|
|
|
|
|
Date :
2012-11-11 20:08:30 |
By :
deawx |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เหมือนกับว่าค่ามันว่าง ลองใช้ or die (mysql_error()); แทนครับ
|
|
|
|
|
Date :
2012-11-12 08:55:02 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
นี้ครับ Code ทั้งหมด
<?php
$hostname = "localhost";
$username = "root";
$password = "1234";
$dbname = "db_system";
$Config = mysql_connect( $hostname, $username, $password );
if ( ! $Config )
die ( "ไม่สามารถติดต่อกับ MySQL ได้" );
mysql_select_db ($dbname,$Config)
or die ( "ไม่สามารถเลือกฐานข้อมูล db_system ได้" );
if ($_REQUEST['Save1']= "บันทึก")
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("db_system");
$strSQL = "INSERT INTO resume ";
$strSQL .="( Res_IDPersonnel, Res_Prefix, Res_Names, Res_lastname, Res_Names_Eng,
Res_Ldentitycode, Res_Blood, Res_NickName, Res_Sex, Res_Tel, Res_Email, Res_Birthday, Res_Address, Dis_DistrictID, Res_PostalCode,
Bel_BelongID, Res_Duty, Res_DayOperations, Res_Salary, Bos_BossID, Res_IDTheDriver, Res_Educational, Res_Emergency, Res_Father,
Res_TelFather, Res_Mather, Res_TelMather, Vac_VacationID, Lae_LaeveID, Rig_RightID, Group, Cal_ID) ";
$strSQL .="VALUES ";
$strSQL .="('".$_POST["txtRes_IDPersonnel"]. "','" .$_POST["txtRes_Prefix"]. "','" .$_POST["txtRes_Names"]. "' ";
$strSQL .=",'" .$_POST["txtRes_lastname"]. "','" .$_POST["txtRes_Names_Eng"]. "','" .$_POST["txtRes_Ldentitycode"]. "' ";
$strSQL .=",'" .$_POST["txtRes_Blood"]. "','" .$_POST["txtRes_NickName"]. "','" .$_POST["txtRes_Sex"]. "' ";
$strSQL .=",'" .$_POST["txtRes_Tel"]. "','" .$_POST["txtRes_Email"]. "','" .$_POST["txtRes_Birthday"]. "' ";
$strSQL .=",'" .$_POST["txtRes_Address"]. "','" .$_POST["txtDis_DistrictID"]. "','" .$_POST["txtRes_PostalCode"]. "' ";
$strSQL .=",'" .$_POST["txtBel_BelongID"]. "','" .$_POST["txtRes_Duty"]. "','" .$_POST["txtRes_DayOperations"]. "' ";
$strSQL .=",'" .$_POST["txtRes_Salary"]. "','" .$_POST["txtBos_BossID"]. "','" .$_POST["txtRes_IDTheDriver"]."' ";
$strSQL .=",'" .$_POST["txtRes_Educational"]."','".$_POST["txtRes_Emergency"]. "','" .$_POST["txtRes_Father"]."' ";
$strSQL .=",'" .$_POST["txtRes_TelFather"]. "','" .$_POST["txtRes_Mather"]. "','" .$_POST["txtRes_TelMather"]."' ";
$strSQL .=",'".$_POST["txtVac_VacationID"]."','".$_POST["txtLae_LaeveID"]."','".$_POST["txtRig_RightID"]."' ";
$strSQL .=",'".$_POST["txtGroup"]."','".$_POST["txtCal_ID"]."') ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
echo "Save Done.";
}
else
{
echo "Error Save [".$strSQL."]";
}
mysql_close($objConnect);
?>
<!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=windows-874" />
<title>ข้อมูลส่วนตัว</title>
</head>
<body>
<form action="resume" name="frmAdd" method="post">
<body bgcolor="#0099FF">
<table width="903" border="0" align="center" cellpadding="0">
<tr>
<td height="125" colspan="2"> </td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>รหัสประจำพนักงาน</strong></font></td>
<td><input type="text" name="txtRes_IDPersonnel" size="50" id="txtRes_IDPersonnel"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>คำนำหน้า </strong></font></td>
<td><input type="text" name="txtRes_Prefix" size="20" id="txtRes_Prefix"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ชื่อพนักงาน </strong></font></td>
<td><input type="text" name="txtRes_Names" size="20" id="txtRes_Names"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>นามสกุลพนักงาน</strong></font></td>
<td><input type="text" name="txtRes_lastname" size="20" id="txtRes_lastname"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ชื่อภาษาอังกฤษ</strong></font></td>
<td><input type="text" name="txtRes_Names_Eng" size="50" id="txtRes_Names_Eng"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>รหัสประจำตัวประชาชน</strong></font></td>
<td><input type="text" name="txtRes_Ldentitycode" size="50" id="txtRes_Ldentitycode"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>หมู่โลหิต</strong></font></td>
<td><input type="text" name="txtRes_Blood" size="50" id="txtRes_Blood"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ชื่อเล่น</strong></font></td>
<td><input type="text" name="txtRes_NickName" size="50" id="txtRes_NickName"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>เพศ</strong></font></td>
<td><input type="text" name="txtRes_Sex" size="50" id="txtRes_Sex"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>เบอร์ติดต่อ</strong></font></td>
<td><input type="text" name="txtRes_Tel" size="50" id="txtRes_Tel"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>E-Mail</strong></font></td>
<td><input type="text" name="txtRes_Email" size="50" id="txtRes_Email"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>วันเกิด</strong></font></td>
<td><input type="text" name="txtRes_Birthday" size="50" id="txtRes_Birthday"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ที่อย</strong></font></td>
<td><input type="text" name="txtRes_Address" size="50" id="txtRes_Address"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ตำบล</strong></font></td>
<td><input type="text" name="txtDis_DistrictID" size="50" id="txtDis_DistrictID"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>รหัสไปรษณีย</strong></font></td>
<td><input type="text" name="txtRes_PostalCode" size="50" id="txtRes_PostalCode"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>สังกัด</strong></font></td>
<td><input type="text" name="txtBel_BelongID" size="50" id="txtBel_BelongID"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>หน้าที่</strong></font></td>
<td><input type="text" name="txtRes_Duty" size="50" id="txtRes_Duty"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>วันที่เริ่มปฏิบัติงาน</strong></font></td>
<td><input type="text" name="txtRes_DayOperations" size="50" id="txtRes_DayOperations"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>เงินเดือน</strong></font></td>
<td><input type="text" name="txtRes_Salary" size="50" id="txtRes_Salary"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>หัวหน้าผู้ควบคุม</strong></font></td>
<td><input type="text" name="txtBos_BossID" size="50" id="txtBos_BossID"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>บัตรประจำผู้ขับขี่</strong></font></td>
<td><input type="text" name="txtRes_IDTheDriver" size="50" id="txtRes_IDTheDriver"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>วุฒิการศึกษา</strong></font></td>
<td><input type="text" name="txtRes_Educational" size="50" id="txtRes_Educational"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>กรณีฉุกเฉินแจ้ง</strong></font></td>
<td><input type="text" name="txtRes_Emergency" size="50" id="txtRes_Emergency"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>บิดา</strong></font></td>
<td><input type="text" name="txtRes_Father" size="50" id="txtRes_Father"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>เบอร์โทรศัพท์บิดา</strong></font></td>
<td><input type="text" name="txtRes_TelFather" size="50" id="txtRes_TelFather"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>มารดา</strong></font></td>
<td><input type="text" name="txtRes_Mather" size="50" id="txtRes_Mather"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>เบอร์โทรศัพท์มารดา</strong></font></td>
<td><input type="text" name="txtRes_TelMather" size="50" id="txtRes_TelMather"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ประเภทวันหยุด</strong></font></td>
<td><input type="text" name="txtVac_VacationID" size="50" id="txtVac_VacationID"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ประเภทการลา</strong></font></td>
<td><input type="text" name="txtLae_LaeveID" size="50" id="txtLae_LaeveID"></td>
</tr><tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>การลา</strong></font></td>
<td><input type="text" name="txtRig_RightID" size="50" id="txtRig_RightID"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>กลุ่มการลาของพนักงาน</strong></font></td>
<td><input type="text" name="txtGroup" size="50" id="txtGroup"></td>
</tr>
<tr>
<td><font size="3" face="Tahoma, MS Sans Serif"><strong>ปฎิทินการหยุดงาน</strong></font></td>
<td><input type="text" name="txtCal_ID" size="50" id="txtCal_ID" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Save1" value="บันทึก" />
<input type="submit" name="Edit1" value="แก้ไข" /></td>
</tr>
</table>
<tr bgcolor="#0099FF">
<td> </td>
<td> </td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
</form>
</body>
</html>
|
|
|
|
|
Date :
2012-11-12 09:20:45 |
By :
pongtave |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|