|
 |
|
การเก็บข้อมูลลงในฐานข้อมูล ขอความช่วยเหลือด้วยนะคะ พอดีว่าจะเก็บข้อมูลลงในฐานข้อมูลให้มีลักษณะเป็นแบบ |
|
 |
|
|
 |
 |
|
copy code มาดีกว่าครับ 
|
 |
 |
 |
 |
Date :
2009-09-22 14:45:31 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
(โค้ด PHP )
<?php
include "../ConnectionDb.php";
$str_sql1 ="SELECT MAX(pr_order) AS now_id FROM pr_decription";
mysql_query("SET NAMES tis620");
$result1=mysql_query($str_sql1);
$rs1=mysql_fetch_array($result1);
$pr_order =$rs1['now_id']+1;
?>
<?php
include "../ConnectionDb.php";
$str_sql2 ="SELECT MAX(DocNo ) AS now_Do FROM pr_decription";
mysql_query("SET NAMES tis620");
$result2=mysql_query($str_sql2);
$rs2=mysql_fetch_array($result2);
$DocNo=$rs2['now_Do']+1;
?>
<?php
@session_start("login_true_mem");
include("../ConnectionDb.php");
$date = date( "Y-m-d" );
$year = date( "Y" );
$m=date("m");
$sql2 = "insert into pr_decription (DocNo,pr_order,login_true_mem,date,get_date,year,type) values( '$DocNo2 ','$pr_order','$login_true_mem','$date','$get_date','$year','$type')";
mysql_query("SET NAMES tis620");
mysql_query($sql2) or die($sql2."".mysql_error());
for($i=0;$i<count($_POST["decription_n"]);$i++)
{
$sql = "insert into decription (DocNo,pr_order,decription_n, unit,quantity,price_unit,shop,job,memo_dec,vat) values('".$_REQUEST[DocNo]."','".$_REQUEST[pr_order]."','$decription_n[$i]', '$unit[$i]','$quantity[$i]', '$price_unit[$i]','$shop[$i]','$job[$i]','$memo_dec[$i]','$vat[$i]')";
mysql_query("SET NAMES tis620");
mysql_query($sql) or die($sql."".mysql_error());
}
?>
<html>
<head>
<title>Order Complete</title>
<meta http-equiv=refresh content=4;URL=index2.php>
<link rel=stylesheet href=cart.css type=text/css>
<style type="text/css">
</head>
<body background=img/bkg.gif>
<p class=Tahoma align=center ><img src="../images/tkk.PNG" width="265" height="171">
<p align=center class=Tahoma ><b><u><font color="#FF9900" size="6">การขอซื้อสินค้าเรียบร้อยแล้ว</FONT></u></b><br>
<p class=Tahoma align=center ><span class="style1"> <font size="4">.....โปรดรอการติดต่อกลับจากแผนกจัดซื้อ.....</FONT></span>
<br>
<b> ขอขอบคุณที่ใช้บริการ</b>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-09-22 14:52:40 |
By :
T_T |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณหมายถึง Insert ได้ปกติ แล้วไม่สามารถนำมาแสดงได้หรือครับ
|
 |
 |
 |
 |
Date :
2009-09-22 14:58:10 |
By :
taobsd |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช่ค่ะ พอเรา Insert ข้อมูลลงใน Database ข้อมูลบางส่วนเก็บได้ถูกต้อง แต่ข้อมูลมันไม่โชว์ขึ้นหน้า web เลย หลังจากที่ดิฉันเพิ่มฟิวส์ Docno ให้เก็บเป็น 255209008 และ ฟิวส์ pr_order เก็บเป็น CPMK028/ 2552 ในตาราง
pr_decription และ decription ทั้ง 2 ตารางเก็บค่าฟิวส์ Docno และฟิวส์ pr_order เหมือนกัน ตาราง decription เก็บข้อมูลได้ตามที่ต้องการ ปัญหาอยู่ที่ตาราง pr_decription ยังเก็บค่าแบบที่ต้องการไม่ได้ค่ะ ก็เลยส่งผลให้ข้อมูลไม่โชว์ขึ้นบน web หรือเปล่าค่ะ
|
 |
 |
 |
 |
Date :
2009-09-22 15:13:58 |
By :
T_T |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|