Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > PHP > PHP Forum > code update record ช่วยดูห่หน่อยค่ะ ว่ามันผิดตรงไหน หายังไงก้อหาไม่เจอ


[PHP] code update record ช่วยดูห่หน่อยค่ะ ว่ามันผิดตรงไหน หายังไงก้อหาไม่เจอ

 
Topic : 074378



โพสกระทู้ ( 386 )
บทความ ( 0 )



สถานะออฟไลน์
Twitter


Memberformedit.php

001.<? include "headlog.php" ;?>
002.<? include("scrip.php"); ?>
003.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
004.<html xmlns="http://www.w3.org/1999/xhtml">
005.<style type="text/css">
006.<!--
007..style1 {color: #FF0000}
008..style2 {color: #000000}
009..style3 {color: #0000FF}
010.-->
011.</style>
012.<head>
013.<meta http-equiv=Content-Type content="text/html; charset=utf-8">
014.<title>..:::ระบบจัดการกลุ่มออมทรัพย์เพื่อการผลิต:::..</title>
015.<link href="style.css" rel="stylesheet" type="text/css" />
016.<link href="main_style.css" rel="stylesheet" type="text/css" />
017.</head>
018.<?
019.    $strDefault = $objResult2["prefix"] ;
020.    mysql_connect("localhost","root","1234") or die(mysql_error());   
021.    mysql_select_db("savingdbdb");
022.?>
023. 
024.<body>
025.<div class="warp" >
026.  <div class="body" >
027.    <div id="left_block">
028.          <p style=" clear:both;margin:10px 0 0;">
029.             <div class="manu_list" style="margin-top:1px;">
030.              <td colspan="2"><img src="images/menu.gif" width="220" height="30" /></td>
031.                   <a href="authdepindex.php">หน้าแรก</a>
032.                   <a href="authdepprofile">ข้อมูลส่วนตัว</a>
033.                   <a href="authdepmem">จัดการข้อมูลสมาชิก</a>
034.                   <a href="authdepitem">จัดการข้อมูลเงินฝาก</a>           
035.                   <a href="authdepdiv">คำนวณเงินปันผล</a>
036.                   <a href="authdeppaydiv">ข้อมูลการจ่ายเงินปันผล</a>
037.                   <a href="authnews">จัดการข้อมูลข่าวประชาสัมพันธ์</a>
038.                   <a href="logout.php">ออกจากระบบ</a>
039.             </div>
040.          </p>         
041.    </div>
042.</div>
043.<div id="right_block">
044.    <font size="18" color="#993300"><b><center>  แก้ไขข้อมูลสมาชิก  </center></b></font>
045.<form action="savememedit.php?user_id=<?=$_GET["uID"];?>" name="frm" method="post">
046.<?
047.include("connect.php");
048.$strSQL "SELECT * FROM user WHERE user_id = ".$_GET["uID"];
049.$objQuery = mysql_query($strSQL);
050.$objResult = mysql_fetch_array($objQuery);
051.if(!$objResult)
052.{
053.    echo "Not found user_id=".$_GET["uID"];
054.}
055.else
056.{
057.?>
058. 
059.<table  width="96%"  border="0" align="center" cellpadding="1" cellspacing="0" bordercolor="#000066">
060.    <tr>
061.        <td width="23%" height="38" align="right"><strong>คำนำหน้า  :</strong></td>
062.        <td width="72%" align="left">
063.          &nbsp;&nbsp;
064.          <select name="txtprefix">          
065.            <option value="">--คำนำหน้า--</option>
066.            <?
067.                $strSQL= "SELECT * FROM prefix";
068.                $objQuery2 = mysql_query($strSQL);
069. 
070.                while($objResult2 = mysql_fetch_array($objQuery2))
071.                {
072.                    if($objResult["prefix"] == $objResult2["prefix_id"])
073.                    {
074.                        $sel = "selected='selected'";
075.                    }
076.                    else
077.                    {
078.                        $sel = "";
079.                    }
080.            ?>
081.                <option value="<?=$objResult2["prefix_id"];?>" <?=$sel;?>>
082.                    <?=$objResult2["prefix_name"];?>
083.                </option>
084.            <?
085.                }
086.            ?>
087.        </select>     <td width="2%" align="left">&nbsp;</td>
088.        <td width="2%" align="left">&nbsp;&nbsp;</td>
089.    </tr>
090.    <tr>
091.        <td height="34" align="right">
092.            <strong>ชื่อ  :</strong></td>
093.            <td align="left">&nbsp;&nbsp;
094.                <input type="text" name="txtfname" value="<? echo $objResult['fname'];?>" > &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
095.            <strong>นามสกุล :</strong>&nbsp;&nbsp;
096.              <input type="text" id="txtlname" name="txtlname" value="<?=$objResult['lname']?>">
097.        </td>
098.        <td height="34" align="right">&nbsp;</td>
099.        <td align="left">&nbsp;</td>
100.    </tr>
101.    <tr>
102.      <td height="86" align="right"><strong>ที่อยู่ :</strong></td>
103.      <td align="left">&nbsp;&nbsp;
104.        <textarea name="txtaddress" cols="38" rows="4" id="txtaddress" ><?=$objResult["address"]; ?></textarea></td>
105.      <td align="left">&nbsp;</td>
106.      <td align="left">&nbsp;&nbsp; </td>
107.      </tr>
108.        <td height="38" align="right"><strong>หมายเลขบัตรประชาชน  :</strong></td>
109.        <td align="left">&nbsp;&nbsp;
110.          <input type="text" id="txtidcard" name="txtidcard" maxlength="13" value="<?=$objResult["idcard"];?>">
111.        &nbsp;&nbsp; <font color="red">**13 ตัวอักษร**</font> </td>
112.        <td align="left">&nbsp;</td>
113.        <br />
114.        <td align="left">&nbsp;&nbsp;</td>
115.    </tr>
116.    <tr>
117.        <td height="38" align="right"><strong>วันเกิด  :</strong></td>
118.        <td align="left">&nbsp;&nbsp;
119.            <input type="text" id="txtbirth" name="txtbirth" value="<?=$objResult["birth"];?>" /> &nbsp;&nbsp;
120.           <a href="javascript:displayDatePicker('txtbirth')"><img border="0" src="images/calendar.jpg" width="19" height="19" /></a></td>
121.            <td align="left">&nbsp;</td>
122.            <td align="left">&nbsp;&nbsp;        </td>
123.            <td width="0%" align="left"><a href="javascript:displayDatePicker('txtbirth')">
124.        </a>
125.        </td>   
126.        <td width="1%" align="left">&nbsp;      </td>
127. 
128.    </tr>
129.    <tr>
130.        <td height="41" align="right"><strong>เบอร์ติดต่อ  :</strong></td>
131.      <td align="left">&nbsp;&nbsp;
132.        <input type="text" id="txttelephone" name="txttelephone" value="<?=$objResult["telephone"];?>"/>
133.        &nbsp;&nbsp; <span class="style1">**ตย. 089-0000000**</span></td>
134.        <td align="left">&nbsp;</td>
135.        <td align="left">&nbsp;&nbsp;</td>
136.    </tr>
137.    <tr>
138.      <td height="37" align="right"><strong>อาชีพ :</strong></td>
139.      <td align="left">&nbsp;&nbsp;
140.          <input type="text" id="txtoccupation" name="txtoccupation" value="<?=$objResult["occupation"];?>"/>
141.            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>รายได้เฉลี่ยต่อเดือน :&nbsp;&nbsp;
142.          <input name="txtsalary" type="text" id="txtsalary" size="10" value="<?=$objResult["salary"];?>"/>
143.        &nbsp;&nbsp; บาท</strong>
144.      </td>
145.      <td align="left">&nbsp;</td>
146.      <td align="left">&nbsp;&nbsp; </td>
147.      </tr>
148.    <tr>
149.        <td height="37" align="right"><strong>จำนวนเงินฝากต่อเดือน :</strong></td>
150.        <td align="left"> &nbsp;&nbsp;
151.        <input type="text" id="txtdep_mount" name="txtdep_mount" value="<?=$objResult["dep_mount"];?>"/>
152.        &nbsp;<strong>บาท</strong></td>
153.        <td align="left">&nbsp;</td>
154.        <td align="left">&nbsp;</td>
155.    </tr>
156.<br/><br/> 
157.    <tr>
158.        <td  align="center">
159.        <td  align="center">
160.              <div align="left">
161.                  &nbsp;&nbsp;&nbsp;&nbsp;
162.                  <input type="submit" value="บันทึก" />
163.                  <input type="reset" value="ยกเลิก" />
164.        &nbsp;&nbsp; </div></td>
165.        <td  align="center">&nbsp;</td>
166.        <td  align="center">
167.            <div align="left">
168.              <p>&nbsp;             </p>
169.              <p>&nbsp;                </p>
170.          </div></td>
171.        </td>
172.    </tr>
173.</table>
174.   <?
175.  }
176.  mysql_close($objConnect);
177.  ?>
178. 
179.  </form>
180.      <br/>  
181.</p>
182.</div>


savememedit.php
01.<html>
02.<head>
03.<meta http-equiv=Content-Type content="text/html; charset=utf-8">
04.</head>
05.<body>
06. 
07.<?
08.    include("connect.php");
09. 
10. 
11. 
12.$strSQL = "UPDATE user SET ";
13.$strSQL .="prefix = '".$_POST["txtprefix"]."' ";
14.$strSQL .=",fname = '".$_POST["txtfname"]."' ";
15.$strSQL .=",lname = '".$_POST["txtlname"]."' ";
16.$strSQL .=",address = '".$_POST["txtaddress"]."' ";
17.$strSQL .=",idcard = '".$_POST["txtidcard"]."' ";
18.$strSQL .=",birth = '".$_POST["txtbirth"]."' ";
19.$strSQL .=",telephone = '".$_POST["txttelephone"]."' ";
20.$strSQL .=",occupation = '".$_POST["txtoccupation"]."' ";
21.$strSQL .=",salary = '".$_POST["txtsalary"]."' ";
22.$strSQL .=",dep_mount = '".$_POST["txtdep_mount"]."' ";
23.$strSQL .="WHERE user_id = '".$_GET["uID"]."' ";
24.$objQuery = mysql_query($strSQL);
25. 
26.if($objQuery)
27.    {
28.        //echo "<meta http-equiv='refresh' content='0; url=adm.php '>";
29.        echo "<script>alert('บันทึกเรียบร้อยแล้ว');</script>";
30.        echo "<meta http-equiv='refresh' content='0; url=authdepmem.php'>";
31.    }
32.    else
33.    {
34.        echo "<center>ไม่สามารถบันทึกได้[".$strSQL."]</center>";
35.    }
36.    mysql_close($objConnect);
37.?>
38.</body>
39.</html>




Tag : PHP, Ms Access

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-02-23 10:40:54 By : lookpla26 View : 923 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code (PHP)
1.$objQuery = mysql_query($strSQL) or die(mysql_error());


จะได้รู้ว่า error เพราะอะไรครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-02-23 10:59:27 By : webmaster
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : code update record ช่วยดูห่หน่อยค่ะ ว่ามันผิดตรงไหน หายังไงก้อหาไม่เจอ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่