|
|
|
|
俵ÀÌ / 2000-08-14 / ¿ÀÀü 12:07:27 / 210.221.238.102
Á¶È¸¼ö : 133
|
[Áú¹®] 俵´Ô À̰͵µ ºÁÁÖ¼¼¿ä. ´õ ¹ÌÄ¡´Â°Å¿¡¿ä. |
> ¹Ø¿¡ ¼Ò½º´Â ÅõÇ¥Çϱâ(üũ¹Ú½º·Î starnumÀ̶ó´Â º¯¼ö¸¦ ¹Þ¾Æ¼ ÅõÇ¥¼ö Áõ°¡¸¦ ÇØÁÖ´Â ºÎºÐÀÔ´Ï´Ù. starnumÀÌ ÇÑ °³¿¡¼ µÎ°³±îÁö ³Ñ¾î ¿À´Â ºÎºÐÀ̶ó¼ splitÇÔ¼ö¸¦ ÀÌ¿ëÇß±¸¿ä. ±×¸®°í, ³Ñ¾î¿Â ¹è¿ °¹¼ö array_num¸¦ ¼¼¾î¼ Å×ÀÌºí¿¡ µ¥ÀÌÅ͸¦ Á¶°Çº°·Î »ðÀÔÇϴ°ſ¡¿ä.
> starnumÀÌ Çϳªµç µÎ°³µç Á¦´ë·Î µ¥ÀÌÅÍ°¡ ³Ñ¾î¿À°í
> µÎ°³ ³Ñ¾î¿Ã¶§ snum(0),snum(1) Á¦°ªÀÌ ³Ñ¾î¿À´Âµ¥
> ¹®Á¦´Â ¾Õ¿¡¼ µÎ°³ÀÇ ´Ù¸¥ üũ¸¦ Çߴµ¥, ÇÑ °÷¿¡¸¸ ¾÷µ¥ÀÌÆ®°¡ µÇ¿ä
> ¾÷µ¥ÀÌÆ®°¡ snum(0)À̶ó´Â °÷¿¡¸¸ µÈ´Ù´Â °Ì´Ï´Ù. µû·Î µû·Î ÇÑ°³¾¿¸¸ ÁÖ¼®Ã³¸®ÇÏ¸é¼ ¾÷µ¥ÀÌÆ® ½ÃÅ°¸é, Á¶°Ç¿¡ ¸ÂÃß¾î¼ ¾÷µ¥ÀÌÆ®°¡ µÇ´Àµ¥, ¿Ö ¾ÈµÇ´Â°ÅÁö¿ä?
>
> <%
> Set db=Server.CreateObject("ADODB.Connection")
> db.Open("xx")
>
>
>
> starnum=Request.Form("starnum")
>
> snum=split(starnum,",")
>
>
> name=Request.Form("name")
>
> array_num=ubound(split(Request.Form("starnum"),",")) +1
>
>
> if array_num =1 then
>
> sql = "UPDATE starsurvey SET counter = counter + 1 Where starnum='" & snum(0) & "'"
>
> db.Execute sql
>
> ' IP=Request.ServerVariables("REMOTE_ADDR")
>
>
> '
> ' SQL2 = "INSERT INTO surveymember(ip) values ('"& ip &"')"
>
>
>
> 'db.Execute sql2
>
> end if
>
> if array_num =2 then
>
> 'IP=Request.ServerVariables("REMOTE_ADDR")
>
> ' SQL3 = "INSERT INTO surveymember(ip) values ('"& ip &"')"
>
> 'db.Execute sql3
>
> ' ¿©±â°¡ ¹ÌÄ¡´Â ºÎºÐ
>
> sql = "UPDATE starsurvey SET counter = counter + 1 Where starnum='" & snum(0) & "'"
>
> db.Execute sql
>
>
>
> 'Sql = "UPDATE starsurvey SET counter = counter + 1 Where starnum='" & snum(1) & "'"
>
> 'db.Execute sql
>
> 'end if
-----------------------------------------------------------
üũ¹Ú½º¸¦ 2°³¸¦ ¼±ÅÃÇß°í ±× °ªÀÌ 1, 2¶ó¸é
³Ñ¾î¿Ã¶§ °ªÀÌ 1, 2·Î ³Ñ¾î¿À°Ô µË´Ï´Ù.
À̶§ ´Ô²²¼ ','·Î split ÇϽŴٸé.....
¾î¶»°Ô µÇ³ª¸é ù¹ø°´Â '1'ÀÌ°í
µÎ¹ø° °ªÀº ' 2'°¡ µÇ°ÚÁö¿ä?
º¸½Ã´Ù½ÃÇÇ 2¾Õ¿¡ °ø¹éÀÌ Çϳª ´õ ºÙ°Ô µË´Ï´Ù.
±×·¸±â ¶§¹®¿¡ UPDATE°¡ Á¦´ë·Î µÇÁö ¾ÊÀº °ÍÀÔ´Ï´Ù.
±×·¸±â ¶§¹®¿¡ snum=split(starnum,",") ÀÌ·¸°Ô ÇÏ½Ã¸é ¾È µÇ°í
snum=split(starnum,", ")
ÀÌ·¸°Ô ÇÏ¼Å¾ß Á¤»óÀûÀ¸·Î µË´Ï´Ù.
±×·³... ¼ö°íÇϼ¼¿ä...
|
|
|
|