|
 |
|
MR.win สอบถามการ ใช้ ORDER BY DESC LIMIT 0 ,1 เพื่อ query ค่าสุดท้ายของ column ออกมาครับ |
|
 |
|
|
 |
 |
|
ขอดูโครงสร้าง Table หน่อยครับ
|
 |
 |
 |
 |
Date :
2012-01-27 17:36:48 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

นี่เป็นโครงสร้าง table ครับ
ผมอยากได้ค่าล่่าสุดทุกครั้งเวลา record แล้วเอามา sum ใหม่ กับ Input
ผมจะพยายามหาวิธีครับ
ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2012-01-27 19:59:58 |
By :
davcpe |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่รู้ว่าจะตรงตามที่คุณ davcpe ต้องการไหมนะครับ
Code (PHP)
$sqlre="INSERT INTO table1 (column1,column1) VALUES ('$column1','$column2')";
$sqlquery=mysql_db_query($dbname,$sqlre); // insert ลง table แรก
$id=mysql_insert_id(); // query id ล่าสุดที่ได้บันทึกลงไป
$sql="INSERT INTO table2(ID,column) VALUES ('$id','$column')";
$sqlquery=mysql_db_query($dbname,$sql); // insert ลง table 2
mysql_close();
|
 |
 |
 |
 |
Date :
2012-01-27 21:04:19 |
By :
tomonaha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2012-01-28 11:46:49 |
By :
davcpe |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|