gumara

เหนือกว่าเหตุผล ผมไม่มีเหตุผล

เหตุที่ต้อง node+1

Submitted by gumara on Thu, 10/11/2007 - 10:27

คราวก่อนอัพเกรด drupal แล้วมีปัญหา ทำให้มีเหตุให้ต้องลงไปงม database ของ drupal แล้วเจอวิธีจัดการ databaseแบบที่ผมงงๆอยู่ แต่วันนี้เข้าใจแล้ว

คือเวลาเขียนข้อมูลลงไป มันจะบอกเลขว่า node นี้เลขเท่าไหร่ แล้วมันก็จะเก็บค่านั้นไว้ในช่องนึง ซึ่งครั้งต่อไปที่จะเพิ่มข้อมูล มันจะเอาเลขในช่องนั้น มา +1 แล้วเก็บเป็น หมายเลขของ node ที่เราจะเพิ่มในครั้งนี้ ทีนี้ที่ผมงงคือ มันจะเก็บเลขแล้วเอามา +1 ทำไม ในเมื่อมันใช้ autoincrement ก็ได้นี่นา (เรียก autoincrement ป่าวหว่า ลืมแล้ว)

ทีนี้ วันนี้นั่งลบ node ใน blog เลยเข้าใจว่า ถ้าใช้ autoincrement พอลบ node ล่าสุดไป แล้วเขียน node ใหม่ลงไป เลขมันก็จะทับกับ node ที่ลบไปแล้วสิ ดังนั้นเลยต้องใช้ หมายเลข node +1 แทน

วันนี้เข้าใจแล้วค๊าบบบ

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Twitter-style @usersnames are linked to their Twitter account pages.
  • Twitter-style #hashtags are linked to search.twitter.com.

More information about formatting options

rMilk

Comment

Tags

Another ~


Let's chat

User login

del.icio.us/~

tweet me

Add to Technorati Favorites


Stat:

free web tracker