¾È³çÇϼ¼¿ä, HappyCGI ÆÀÀÇ voposÀÔ´Ï´Ù.
>³×..... >articleId INT AUTO_INCREMENT PRIMARY KEY, >threadId INT NOT NULL, >replyId CHAR(50) NOT NULL, >¿©±â¼....articleld ´Â.... ±ÛÀÇ ¹øÈ£.... ±Ùµ¥...µÚ¿¡ AUTO_INCREMENT´Â... >¹¹ÁÒ? ±×¸®°í ÀÌ ¹øÈ£¿¡ PRIMARY KEY¸¦ ¼³Á¤ÇÏ´Â ÀÌÀ¯°¡ ¹¹Áö¿©?
AUTO_INCREMENT ´Â DB ¼¹ö¿¡¼ Á¦°øÇÏ´Â ±â´ÉÀ¸·Î Ä÷³Å¸ÀÔÀÌ ¼ýÀÚÀÌ¸é »õ µ¥ÀÌ Å¸°¡ ÀԷµɶ§ ÀÚµ¿À¸·Î ¼ýÀÚ¸¦ Çϳª Áõ°¡½ÃÄÑ ±â·ÏÇØÁÝ´Ï´Ù.
°¡Àå ÃÖ±Ù¿¡ ±â·ÏµÈ articleId°¡ 33ÀÌ¸é ±× ´ÙÀ½¿¡ ±â·ÏµÇ´Â ·¹ÄÚµåÀÇ articleId ´Â ÀÚµ¿À¸·Î 34°¡ µË´Ï´Ù. Insert ÇÒ ¶§ articleId¸¦ ¾î¶»°Ô Áà¾ßÇÒÁö °í¹ÎÇÏÁö ¾Ê¾Æµµ µÇ°ÚÁÒ?
Å×ÀÌºí¿¡¼ °íÀ¯ÇÑ ·¹Äڵ带 ±¸ºÐÇÏ´Â Ä÷³ÀÌ ÀÖ¾î¾ßÇϴϱî articleId Ä÷³À¸·Î ±ÛÀÇ °íÀ¯ÇÑ ¹øÈ£¸¦ ºÎ¿©Çϴ°̴ϴÙ. ÀÌ ¶§ ±× Ä÷³À» Primary Key ¶ó°í ÇÕ´Ï´Ù.
>threadld °³³äÀ» Àß ÀÌÇظøÇϰڴµ¥¿©....
±ÛÀÇ ±×·ìÀ̶ó°í »ý°¢Çϼ¼¿ä. ¾î´À ±Û¿¡ ´äº¯ÀÌ ÀÖ°í ¶Ç ´äº¯ÀÌ µîµî, ÀÖÀ»¶§ ±× °ü·ÃµÈ ±Û Àüü¸¦ ÇϳªÀÇ ±×·ìÀ̶ó°í ÇսôÙ. ±× ±×·ìÀÇ ¸ðµç ±ÛÀº °°Àº ½º·¹ µå¾ÆÀ̵𸦠°®°Ô µÇ´Â°ÅÁÒ.
articleId°¡ 1ÀÎ ±Û¿¡ ÆÄ»ýµÇ´Â ¸ðµç ±ÛÀÇ threadId´Â °¡Àå ÃÖ»óÀ§ ±ÛÀÇ articleId ·Î ÁÝ´Ï´Ù. ±×·¯¸é ±× ±×·ì ¸ðµç ±ÛµéÀÇ threadId´Â 1ÀÌ µË´Ï´Ù. °Ô½ÃÆÇ ½º·¹µå¸¦ º¸¿©ÁÙ ¶§ "order by threadId desc" ºÎºÐ°ú ¿¬°üÁö¾î »ý°¢Çϸé ÀÌÇØ°¡...
>replyld´Â ´ëÃæÀÌÇØ°¡´Âµ¥¿ä....¸¸¾à ±×°Ô Áú¹®À̶ó¸é replyld¿¡´Â ±×³É >±× Áú¹®ÀÇ ¹øÈ£¸¸ µé¾î°¡°Ô µÇ´Â°Ç°¡¿ä? ±×¸®°í ¸¸¾à Áú¹®¿¡ ´ëÇÑ ´äº¯ÀÌ... >ÇÑ 100°³°¡ µÈ´Ù¸é.... À̶§´Â ²¿¸®¿¡ ²¿¸®´Â ¹«´Â ...... >[Áú¹®]... > [´äº¯]... >
|