|  | 
	                
  
    | 
	 
        ช่วยด้วยครับ   :20: ช่วยแนะนำหน่อยนะครับ  เวลาผมบันทึกข้อมูลแล้ว  เมนูที่อยู่ใน list menu  มันไม่ยอมเข้าไปเก็บในฐานข้อมูลครับ     |  
    |  |  
 
	
		|  |  |  |  |  
		|  |  | 
          
            | ช่วยแนะนำหน่อยนะครับ  เวลาผมบันทึกข้อมูลแล้ว  เมนูที่อยู่ใน list menu  มันไม่ยอมเข้าไปเก็บในฐานข้อมูลครับ  แล้วก็ไม่ยอมแสดงข้อมูลด้วยครับ แต่ข้อมูลอื่นเข้าไปเก็บได้ครับ  ผมทำผิดพลาดตรงไหนครับ  ช่วยดูให้หน่อยครับ ขอบคุงคร้าบ  อีกอย่างช่วยแนะนำการทำ css style  ด้วยก็ดีนะครั บ  ผมทำตามในหนังสือแล้ว ไม่ก็เหมือนเดิมครับ <html>
 <head>
 <title>บันทึกข้อมูล</title>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-874">
 </head>
 <body bgcolor="#CCCCCC">
 <?
 $host="localhost";
 $username="";
 $password="";
 $db="data_from";
 $tb="projecttable";
 $connect= mysql_connect( $host,$username,$password);
 mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้");
 mysql_query("INSERT INTO $tb  values('', '$emp_date', '$emp_mounth','$emp_year','$emp_time','$emp_department','$emp_description','$emp_tel','$emp_subject','$emp_device','$emp_marque','$emp_serie','$emp_pass','$emp_content','$emp_edit','$emp_comment','$emp_navigational','$emp_name ')")or die ("ไม่สามารถบันทึกข้อมูลได้ กรุณาตรวจสอบข้อมูลอีกครั้ง ");
 echo "บันทึกข้อมูลเสร็จเรียบร้อยแล้ว";
 mysql_close($connect);
 ?>
 <?
 $host="localhost";
 $username="";
 $password="";
 $db="data_from";
 $tb="projecttable";
 mysql_connect( $host,$username,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
 mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); /* ทำการเลือกฐานข้อมูลก่อน */
 $sql="Select * From $tb";
 $db_query=mysql_db_query($db,$sql);
 $num_rows=mysql_num_rows($db_query); /* นับ Reccord ที่พบ */
 ?>
 <table width="91%" border="1" align="center">
 <tr>
 <td width="8%" height="24"> <div align="center">emp_id</div></td>
 <td width="12%"> <div align="center">emp_device</div></td>
 <td width="12%"> <div align="center">emp_navigational</div></td>
 <td width="12%"> <div align="center">emp_name</div></td>
 </tr>
 </table>
 <?
 $a=0;
 while($a < $num_rows)
 {
 $result = mysql_fetch_array($db_query);
 $emp_id=$result[emp_id];
 $emp_date=$result[emp_date];
 $emp_mounth=$result[emp_mounth];
 $emp_year=$result[emp_year];
 $emp_device=$result[emp_device];
 $emp_navigational=$result[emp_navigational];
 $emp_name=$result[emp_name];
 ?>
 <table width="91%" border="1" align="center">
 <tr>
 <td width="18%"> <div align="center">
 <?echo"$emp_id";?>
 </div></td>
 <td width="28%">
 <?echo"$emp_device";?>
 </td>
 <td width="27%">
 <?echo"$emp_navigational";?>
 </td>
 <td width="27%">
 <?echo"$emp_name";?>
 </td>
 </tr>
 </table>
 <?
 $a++;
 }
 echo"<center><br>จำนวน Reccord = $num_rows</center>";
 mysql_close();
 ?>
 <p>  </p>
 <form name="form1" method="post" action="work.php">
                                                                                
 <input type="submit" name="Submit2" value="กลับไปหน้าหลัก">
 <input type="submit" name="Submit2" value="ปิดหน้าต่างนี้"onClick="javascript:window.close()">
 </form>
 <p> </p>
 <p> </p>
 <p> </p></body>
 </html>
 
 
 
 Tag : - - - -
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          22 ต.ค. 2550  15:21:50 | By :
                          henry | View :
                          1272 | Reply :
                          3 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |  
		|  |  |  |  |  
  
    | 
 
        
          |  |  |  |  |  
          |  |  | 
            
              | mysql_query("INSERT INTO $tb values('', '$emp_date', '$emp_mounth','$emp_year','$emp_time','$emp_department','$emp_description','$emp_tel','$emp_subject','$emp_device','$emp_marque','$emp_serie','$emp_pass','$emp_content','$emp_edit','$emp_comment','$emp_navigational','$emp_name ')")or die ("ไม่สามารถบันทึกข้อมูลได้ กรุณาตรวจสอบข้อมูลอีกครั้ง "); 
 
 
 print "INSERT INTO $tb values('', '$emp_date', '$emp_mounth','$emp_year','$emp_time','$emp_department','$emp_description','$emp_tel','$emp_subject','$emp_device','$emp_marque','$emp_serie','$emp_pass','$emp_content','$emp_edit','$emp_comment','$emp_navigational','$emp_name ')";
 
 แล้ว copy ไปใส่ ใน myadmin ดูครับ เด๋วคำตอบโผล่
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            22 ต.ค. 2550  17:55:53 | By :
                            thenetxx |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  
 
        
          |  |  |  |  |  
          |  |  | 
            
              | ผมแก้ได้แล้วครับ 
 ทำผิดไปนิดนึง
 
 |  
              | 
                
                  |  |  |  |  
                  |  | 
                      
                        | Date :
                            24 ต.ค. 2550  16:13:32 | By :
                            aof |  |  |  
                  |  |  |  |  |  |  |  
          |  |  |  |  |  |  |