½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
CSS
html
mysql
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 102 | Á¶È¸¼ö 2,415 | µî·ÏÀÏ 2001-04-26 19:51:10

´Ð³×ÀÓ

white

À̸ÞÀÏ

white@happycgi.com

Á¦¸ñ

php+mysql ·£´ýÀ¸·Î ÀÚ·á º¸±â
³»¿ë
php¿¡¼­ randomÀ¸·Î ÀڷḦ °¡Á®¿À´Â ¹æ¹ýÀº ¿©·¯°¡Áö°¡ ÀÖ½À´Ï´Ù¸¸
¿©±â¼­´Â µÎ°¡Áö¸¦ ¼Ò°³Çϵµ·Ï ÇÏ°Ú½À´Ï´Ù.

1. phpÇÔ¼ö ÀÌ¿ëÇϱâ

¢Æ1¿¡¼­ 7±îÁö Á¤¼ö¸¦ ·£´ýÀ¸·Î Ãâ·ÂÇϱâ

$numbers = range (1,7);
srand ((double)microtime()*1000000);
shuffle ($numbers);
while (list (, $number) = each ($numbers)) {
echo "$number ";
}

¡Øshuffle => ¹è¿­ÀÇ Àμö¸¦ ¹«ÀÛÀ§·Î Àç¹èÄ¡ÇÏ´Â ³­¼ö ¹ß»ý±â
¡ØrangeÀÇ Àμö´Â ù¹ø° Àμö°¡ µÎ¹ø° Àμöº¸´Ù ³·¾Æ¾ß ÇÕ´Ï´Ù. ±× »çÀÌ¿¡ ¸ðµç Á¤¼öµéÀÇ ¹è¿­À» ¸®ÅÏÇÏÁÒ.

±Ùµ¥ À§ÀÇ ÇÔ¼ö¸¦ ÀÌ¿ëÇØ º» °á°ú ·£´ýÀ¸·Î ³ª¿À±â´Â ÇÕ´Ï´Ù¸¸ º°·Î ´Ù¾çÇÏÁö ¾Ê¾Ò¾î¿ä. *^^*


2. mysql ÀÌ¿ëÇϱâ

$sql="SELECT number*0+rand() as rand,number,quest FROM $t_name WHERE t='abc' ORDER BY rand LIMIT Ãâ·Â°³¼ö";

¹°·Ð numberÀÇ Å¸ÀÔÀº INT AUTO_INCREMENT PRIMARY KEYÀÔ´Ï´Ù.
ÈξÀ ´Ù¾çÇÑ ·£´ý °ªÀÌ Ãâ·ÂµË´Ï´Ù.*^^*  (pick)
Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û ±×·³ ´ÙÀ½ ´Ü°è´Â 2001-04-26 19:43:58
´ÙÀ½°Ô½Ã±Û ASP °Ô½ÃÆÇ ÀÌ ³×½ºÄÉÀÌÇÁ¿¡¼­ ¿À·ù? 2001-04-26 21:18:20