รบกวนช่วยหน่อยครับ พอแก้ไขเสร็จแล้ว Save ไม่ได้รบกวนดูให้หน่อย
frm edit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>HSA DOWNTIME REPAIR REQUST ONLINE</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-874"><LINK
href="stylesheet.css" type=text/css
rel=stylesheet>
<style type="text/css">
<!--
.style2 {
color: #FF0000;
font-size: 24px;
}
-->
TD {
FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial,Helvetica,Sans-serif
}
INPUT {
FONT-SIZE: 12px; WIDTH: 90px; COLOR: #000000; FONT-FAMILY: Arial,Helvetica,Sans-serif
}
.style4 {font-size: 24px}
</STYLE>
<META content="MSHTML 6.00.2900.2180" name=Mainmenu></HEAD>
<BODY>
<FORM name=frmedit method=post>
<TABLE height=407 cellSpacing=0 cellPadding=0 width=982 border=0>
<TBODY>
<TR>
<TD vAlign=top noWrap align=left width=10> </TD>
<TD vAlign=top noWrap align=left width=181>
<DIV align=left>
<TABLE height=177 cellSpacing=0 cellPadding=0 width="92%" border=0>
<TBODY>
<TR>
<br>
<br>
<TD colSpan=2><STRONG><FONT color=#000000><STRONG>Main
Menu</STRONG></FONT> </STRONG></TD></TR>
<TR>
<TD> </TD>
<TD style="BORDER-BOTTOM: #ff0000 1px solid" #000099?><FONT
face=Tahoma size=2><A
href="index.html">หน้าหลัก</A></FONT></TD></TR>
<TR>
<TD> </TD>
<TD style="BORDER-BOTTOM: #ff0000 1px solid" #000099?><FONT
face=Tahoma size=2><A
href="logout.php">Logout</A></FONT></TD></TR></TBODY></TABLE>
<p><BR>
<BR>
<BR>
<BR>
</p>
<p> </p>
<p> </p>
<p><BR>
<BR>
<STRONG><FONT
color=#000000>Version : 0.00</FONT></STRONG><BR>
<BR>
<BR>
<STRONG><FONT
color=#000000>Powered By</FONT></STRONG> </p>
<p><strong><font color="#000000">HSA Maintenance Team</font></strong></p>
<p><font color="#000000">Tel.3448,4612,3640</font></p>
<p><BR>
</p>
</DIV></TD><!-- gray line -->
<TD width=13 height="100%">
<P style="BORDER-LEFT: #ff0000 1px solid; HEIGHT: 100%"></P></TD>
<TD vAlign=top align=left width=738>
<CENTER>
<DIV class=boldtitle>
<p><img src="images/hitachi_5.png" width="805" height="68"><label><span class="style2"><small> <big><b> HSA DOWNTIME ACTION </b></big></small></span></label>
<span class="style2"></span></p>
<style>
BODY {
FONT-FAMILY: Arial, Helvetica, sans-serif
}
.style1 {color: #FF0000}
</style>
</head>
<body>
<DIV align=center><table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber1"></DIV>
<tr>
<td width="12%" bgcolor="#CCFFFF" align="center"><b><font color="#000080">No.HSA</font></b></td>
<td width="8%" bgcolor="#CCFFFF" align="center"><b><font color="#000080">Line</font></b></td>
<td width="13%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">Date</font></b></td>
<td width="8%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">Shift</font></b></td>
<td width="15%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">Machine</font></b></td>
<td width="10%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">Number Machine</font></b></td>
<td width="28%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">Problem</font></b></td>
<td width="8%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">Downtime ( Min ) </font></b></td>
<td width="8%" bgcolor="#CCFFFF" align="center"><b> <font color="#000080">Edit</font></b></td>
</tr>
<?php
require("config.inc.php");
if (empty($_GET["page"])){
$page=1;
}
else
{
$page=$_GET["page"];
}
mysql_connect($host,$username,$password) or die("ติดต่อฐานข้อมูลไม่ได้");
mysql_select_db($db)or die ("เลืกข้อมูลไม่ได้");
$sql = "select * from hsa25 ";
$result = mysql_query("select id from hsa25 order by ID DESC");
$dbquery = mysql_db_query($db,$sql);
$NRow = mysql_num_rows($result);
$num_rows = mysql_num_rows($dbquery);
$rt = $NRow%$list_page;
if($rt!=0) {
$totalpage = floor($NRow/$list_page)+1;
}
else {
$totalpage = floor($NRow/$list_page);
}
$goto = ($page-1)*$list_page;
$sql = "select * from hsa25 where id order by id DESC limit $goto,$list_page";
$result = mysql_db_query($db,$sql);
$NRow = mysql_num_rows($result);
while($row = mysql_fetch_row($result))
{
?>
<tr>
<td width="12%" bgcolor="#CCCCFF" align="center"><?php echo sprintf("<B>%06d</B>",$row[0]) ; ?></td>
<td width="8%" bgcolor="#CCCCFF" align="center"><?php echo $row[1] ; ?></td>
<td width="13%" bgcolor="#CCCCFF" align="center"><?php echo $row[2] ; ?></td>
<td width="8%" bgcolor="#CCCCFF" align="center"><?php echo $row[5] ; ?></td>
<td width="15%" bgcolor="#CCCCFF" align="center"><?php echo $row[6] ; ?></td>
<td width="10%" bgcolor="#CCCCFF" align="center"><?php echo $row[7] ; ?></td>
<td width="28%" bgcolor="#CCCCFF" align="center"><?php echo $row[8] ; ?></td>
<td width="8%" bgcolor="#CCCCFF" align="center"><?php echo $row[14] ; ?></td>
<td width="8%" bgcolor="#CCCCFF" align="center"><center><a href="editdata2.5.php?id=<?php echo $row[0];?>"><img src="images/edit.gif" width="15" height="15" border="0"></a></center></td>
</tr>
<?Php
}
?>
</table>
<br>
<?php
$result = mysql_query("select count(id) from hsa25");
$row = mysql_fetch_row($result);
$num = $row[0];
echo "<center>";
if ($num == "")
{
//$entry = "ยังไม่มีใบแจ้งซ่อม";
}
else
{
$entry = "<font size=2 color=black><b>มีใบแจ้งซ่อมทั้งหมดจำนวน<Font color=red> $num </Font>ใบ </b></font>";
}
echo "<BR>$entry ";
echo "</center>";
//echo "\t กำลังแสดงหน้าที่ $page/$totalpage \n";
echo "\t<font size=2 color=black><b>หน้าที่ $page/$totalpage</b></font> \n";
echo "<center>";
echo "<center>";
if($page>1 && $page<=$totalpage) {
$prevpage = $page-1;
echo "\t<a href='edit2.5.php?&page=$prevpage'><< Back</a>\n";
}
// วนลูปแสดงเลขหน้าทั้งหมด
for($i=1 ; $i<$page ; $i++) {
echo "\t<a href='edit2.5.php?&page=$i'>$i</a> \n";
}
echo "\t<font size=2 color=red><b>$page</b></font> \n";
for($i=$page+1 ; $i<=$totalpage ; $i++) {
echo "\t<a href='edit2.5.php?&page=$i'>$i</a> \n";
}
if($page!=$totalpage) {
$nextpage = $page+1;
echo "\t<a href='edit2.5.php?&page=$nextpage'>Next >></a>\n";
}
?>
</html>
</body>
</html>
frm Save
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>HSA DOWNTIME REPAIR REQUST ONLINE</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-874"><LINK
href="stylesheet.css" type=text/css
rel=stylesheet>
<style type="text/css">
<!--
.style2 {
color: #FF0000;
font-size: 24px;
}
-->
TD {
FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Arial,Helvetica,Sans-serif
}
INPUT {
FONT-SIZE: 12px; WIDTH: 90px; COLOR: #000000; FONT-FAMILY: Arial,Helvetica,Sans-serif
}
.style4 {font-size: 24px}
</STYLE>
<META content="MSHTML 6.00.2900.2180" name=Mainmenu></HEAD>
<BODY>
<FORM name="save_edit2.5" method="post">
<TABLE height=407 cellSpacing=0 cellPadding=0 width=982 border=0>
<TBODY>
<TR>
<TD vAlign=top noWrap align=left width=10> </TD>
<TD vAlign=top noWrap align=left width=181>
<DIV align=left>
<TABLE height=177 cellSpacing=0 cellPadding=0 width="92%" border=0>
<TBODY>
<TR>
<br>
<br>
<TD colSpan=2><STRONG><FONT color=#000000><STRONG>Main
Menu</STRONG></FONT> </STRONG></TD></TR>
<TR>
<TD> </TD>
<TD style="BORDER-BOTTOM: #ff0000 1px solid" #000099?><FONT
face=Tahoma size=2><A
href="logout.php">Logout</A></FONT></TD></TR></TBODY></TABLE>
<p><BR>
<BR>
<BR>
<BR>
</p>
<p> </p>
<p> </p>
<p><BR>
<BR>
<STRONG><FONT
color=#000000>Version : 0.00</FONT></STRONG><BR>
<BR>
<BR>
<STRONG><FONT
color=#000000>Powered By</FONT></STRONG> </p>
<p><strong><font color="#000000">HSA Maintenance Team</font></strong></p>
<p><font color="#000000">Tel.3448,4612,3640</font></p>
<p><BR>
</p>
</DIV></TD><!-- gray line -->
<TD width=13 height="100%">
<P style="BORDER-LEFT: #ff0000 1px solid; HEIGHT: 100%"></P></TD>
<TD vAlign=top align=left width=738>
<CENTER>
<DIV class=boldtitle>
<p><img src="images/hitachi_5.png" width="805" height="68"><label><span class="style2"><small> <big><b>HSA DOWNTIME REPAIR REQUEST ONLINE</b></big></small></span></label>
<span class="style2"></span></p>
</head>
</html>
<body>
<?php
include("config.inc.php");
$SQL = "UPDATE hsa25 SET ";
$SQL .="id = '".$_GET["id"]."' ";
$SQL .=",cline = '".$_POST["cline"]."' ";
$SQL .=",carlender = '".$_POST["carlender"]."' ";
$SQL .=",Hour = '".$_POST["Hour"]."' ";
$SQL .=",min = '".$_POST["min"]."' ";
$SQL .=",cShift = '".$_POST["cShift"]."' ";
$SQL .=",cMachine = '".$_POST["cMachine"]."' ";
$SQL .=",cNumber = '".$_POST["cNumber"]."' ";
$SQL .=",problem = '".$_POST["problem"]."' ";
$SQL .=",name = '".$_POST["name"]."' ";
$SQL .=",cPosition = '".$_POST["cPosition"]."' ";
$SQL .=",cSection = '".$_POST["cSection"]."' ";
$SQL .=",Hour1 = '".$_POST["Hour1"]."' ";
$SQL .=",min1 = '".$_POST["min1"]."' ";
$SQL .=",sum1 = '".$_POST["sum1"]."' ";
$SQL .=",cdowntime = '".$_POST["cdowntime"]."' ";
$SQL .=",name1 = '".$_POST["name1"]."' ";
$SQL .=",cdate = '".$_POST["cdate"]."' ";
$SQL .=",hour2 = '".$_POST["hour2"]."' ";
$SQL .=",min2 = '".$_POST["min2"]."' ";
$SQL .=",cause = '".$_POST["cause"]."' ";
$SQL .=",action = '".$_POST["action"]."' ";
$SQL .=",name2 = '".$_POST["name2"]."' ";
$SQL .=",name3 = '".$_POST["name3"]."' ";
$SQL .=",name4 = '".$_POST["name4"]."' ";
$SQL .="WHERE id = '".$_GET["id"]."' ";
$objQuery = mysql_query($SQL);
if($objQuery)
{
echo "Save Done.";
echo"<meta http-equiv=\"Refresh\" content=\"0.5;URL=view.php\"/>";
}
else
{
echo "Error Save [".$SQL."]";
}
mysql_close();
?>
</body>
</html>
พอแก้ไขเสร็จแล้ว Save ไม่ได้รบกวนดูให้หน่อยTag : - - - -
Date :
2009-12-09 18:25:32
By :
wat
View :
1037
Reply :
3
ไม่มี Error อะไรหรอครับ?
ลอง echo $SQL; ออกมาดูครับ
Date :
2009-12-09 18:36:56
By :
panyapol
ไม่มีครับ แต่update ค่าใหม่ไม่ได้ครับ
Date :
2009-12-09 18:54:09
By :
wat
$SQL .="id = '".$_GET["id"]."' "; // ไม่น่า update id นะผมว่า
Date :
2009-12-09 19:09:27
By :
peterxp
Load balance : Server 04