|
 |
|
insert ทับที่ ฟิวด์เดิม คือว่าผมจะเพิ่มข้อมูลใน ฟิลด์เดิม ที่มีข้อมูลอยู่แล้วตามรูปภาพอ่ะคับ |
|
 |
|
|
 |
 |
|
update เฉยๆ หรือเปล่า
|
 |
 |
 |
 |
Date :
2009-07-22 18:51:09 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่อ ถ้าอัพเดชเฉยๆผมทำได้อยู่อ่ะครับ
แต่อยากลองดูว่า สามารถ insert ในขณะมีข้อมูลอยู่แล้วแต่เลือกการ insert แค่บ้างส่วนดูแต่คงข้อมูลเดิมไว้อ่ะครับ
แต่ลองทำตามเพ่ วินบอก นั้นไม่รู้ว่าผมดัดแปลงมาใช้ถูกหรือเปล่าอ่ะครับ เพ่ว่าเวลา เพิ่มข้อมูลเข้าไปมันบอก No Query Mysql อ่ะคับ
$user_test1 กับ $user_test11 รับมาจาก from ครับ
Code (PHP)
<?php
$Sql = "Insert Into tbuser Values ('', '$username', '$password', '$name', '$lname' , '$sex' ,'$selectdress','$selectcoss', '$date', '$time') ON DUPLICATE KEY UPDATE test1='$user_test1',test11='$user_test11' ";
$table = mysql_query($Sql,$Conn) or die ("No Query Mysql");
?>
ON DUPLICATE KEY UPDATE test1='$user_test1',test11='$user_test11'
ด้วยความอยากรู้อ่ะครับ ถ้าไม่ได้จะได้ไปใช้ Update ธรรมดาครับ
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2009-07-22 19:16:50 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้หรอครับ
ยังงัยคำสั่ง insert ก็เป็นการเพิ่ม record อยู่ดี
ถ้าจะให้มัน เพิ่มข้อมูลใน record เดิม ยังงัยก็ต้อง ใช้ update นะครับ
|
 |
 |
 |
 |
Date :
2009-07-22 19:50:14 |
By :
martman26 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ต้องถามว่าทำเพื่ออะไร
|
 |
 |
 |
 |
Date :
2009-07-22 21:15:28 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมว่าคุณ phpbasic ใช้แบบธรรมดาๆก็น่าจะได้นะครับ อีกอย่าง งานจะได้เดินเร็วด้วย 
|
 |
 |
 |
 |
Date :
2009-07-22 22:59:22 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
งานมีกี่ขาครับ ระวังขาขาดทำงานไม่ได้นะ
เอ้าพี่น้องช่วยกันฮาครับ.....ถ้าไม่ฮากรุณาอย่าเครียด 
|
 |
 |
 |
 |
Date :
2009-07-22 23:01:36 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณม๊ากมากครับ ตอนนี้กับมาใช้แบบเดิมล่ะ อิอิอิ รวดเร็วทันใจวัยรุ่น แต่ก็ได้คำสั่งใหม่ๆเพิ่มขึ้นมาอีกคำสั่งที่เพ่ วินให้มานั้นแหละ 
|
 |
 |
 |
 |
Date :
2009-07-23 10:46:42 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|