>°Ô½ÃÆÇ¿¡¼ ´äº¯À» happycgi¿Í °°ÀÌ Áú¹® ¹Ù·Î ¹Ø¿¡ Ãâ·ÂÀÌ µÇ°Ô ÇÏ·Á°í >Çϴµ¥¿ä.... mysql¿¡¼ µ¥ÀÌÅ͸¦ »ðÀÔÇÒ¶§ insert into Çϸé >Á¦ÀÏ ¹Ø¿¡ Â÷·Ê´ë·Î ½×ÀÌÀÚ³ª¿ä? >¾î¶»°Ô Áú¹®-´äº¯À» ±¸ÇöÇØ ³¾¼ö ÀÖÁÒ?
¾È³çÇϼ¼¿ä, HappyCGI ÆÀÀÇ voposÀÔ´Ï´Ù.
ÀÌÀü¿¡ ºñ½ÁÇÑ Áú¹®¿¡ ´ëÇÑ ±ÛÀÌ ÀÖ¾ú´Âµ¥ ¾Æ¹«¸® ãÀ»·¡µµ ¾ÈµÇ´Â±º¿ä.
Æ÷·³½º·¹µå¸¦ Çس»´Â ¹æ¹ýÀº ¸î°¡Áö°¡ Àִ°ɷΠ¾Æ´Âµ¥ ÇØÇÇ¿¡¼ »ç¿ëÇÏ´Â ¹æ½Ä À» °£´ÜÇÏ°Ô ¼³¸íµå¸®°Ú½À´Ï´Ù.
¸ÕÀú Æ÷·³Å×ÀÌºí¿¡ ½º·¹µåÇü½ÄÀ» À§ÇØ ÇÊ¿äÇÑ Ä÷³À» ´ÙÀ½Ã³·³ Àâ½À´Ï´Ù.
articleId INT AUTO_INCREMENT PRIMARY KEY, threadId INT NOT NULL, replyId CHAR(50) NOT NULL,
articleId => ±ÛÀÇ °íÀ¯ÇÑ ¹øÈ£ threadId´Â => ¾î¶² ½º·¹µåÀÇ ÃÖ»óÀ§ ±ÛÀÇ articleId
replyId´Â "¼ýÀÚ-¼ýÀÚ-¼ýÀÚ" Çü½ÄÀÔ´Ï´Ù. ¸¸ÀÏ articleIdÀÇ Ã¹¹ø° ´äº¯±ÛÀº 1-01, µÎ¹ø° ´äº¯±ÛÀº 1-02, articleId 1ÀÇ ´äº¯±ÛÀÇ ´äº¯±ÛÀº 1-01-01, ´äº¯±ÛÀÇ µÎ¹ø ° ´äº¯±ÛÀº 1-01-02°¡ µÇ´ÂÇü½ÄÀÔ´Ï´Ù.
¾î¶² ±ÛÀÇ Æ¯Á¤ ±íÀÌ(depth)ÀÇ ´äº¯±ÛÀÌ ¸î°³ÀÎÁö¸¦ ¾Ë¾Æ³»¾ß°ÚÁÒ? ±×·¡¾ß ±× °¹ ¼ö¿¡ ¶§¶ó ¹øÈ£¸¦ ¸Å°Ü ÀúÀåÀ» Çؾߴϱî¿ä. ±×°Ç Á÷Á¢Çغ¸¼¼¿ä, Àç¹ÌÀÖÀ»°Ì´Ï´Ù.
½º·¹µå ¸®½ºÆ®¸¦ Ãâ·ÂÇÒ ¶§´Â ¿ä·±½ÄÀ¸·Î...
SELECT * FROM tbl_name ORDER BY threadId DESC,replyId;
¼³¸íµå¸° ¹æ½ÄÀº ÀúÀåÇϱⰡ ÈûµéÁö¸¸ ½º·¹µå Ãâ·ÂÀº °£´ÜÇÏ´Ù´Â ÀåÁ¡ÀÌ ÀÖ½À´Ï´Ù.
°¨»çÇÕ´Ï´Ù.
- vopos
/---------------------------------------------------------------------------------------------------- ÀÚÁÖ¹¯´Â Áú¹® Æ÷·³°ú Æ÷·³°Ë»öÀ» ÀÌ¿ëÇϼż ºñ½ÁÇÑ Áú¹®ÀÇ ´äº¯ÀÌ ÀÖ´ÂÁö È®ÀÎÇÏ½Ã°í ±Û ¿Ã·ÁÁÖ½Ã±æ ºÎŹµå¸³´Ï´Ù. ----------------------------------------------------------------------------------------------------/
|