Captcha security check reoto.com is for sale Please prove you're not a robot View Price Processing
Captcha security check reoto.com is for sale Please prove you're not a robot View Price Processing
2012å¹´7æ13æ¥éææ¥ [PHP] åºç¾çã«åãã®ããã©ã³ãã ãªæ°åã®ä½ãæ¹ çããé£ç¶æ´æ°ãªã¿ãã¨ã§ããããã«ã¡ã¯ï¼ããã«ã¡ã¯ï¼ PHPã«ã¯ä¹±æ°ãçºçããã rand() ãããã¯mt_rand() é¢æ°ãããã¾ããã éã¿ä»ãã©ã³ãã æ°ãåºç¾çã«åãã®ããã©ã³ãã æ°ãçºçãããé¢æ°ãè¦å½ããã¾ãã(å½ç¤¾è¦³æ¸¬ã«åºã¥ã) ãããæ¨ä»ã§ã¯ã½ã¼ã·ã£ã«ã²ã¼ã ã«ä»£è¡¨ãããã²ã¼ã ã®è£å´ã«PHPãç¨ãããããã¨ãå¤ãããã§ã ãã¾ã©ããã¬ãã£ã ã®ãã¡ã¼ã¸è¨ç®ã ã®(ãã©ã¯ã¨çãª)ã¬ãã«ã¢ãããã¼ãã¹ã ã®ãã²ã¼ã ç³»ã§ã¯å¿ é ã®é¢æ°ã¨ãªãã¾ãã ã¨ããããã§ãã·ã³ãã«ãªãåºç¾çã«åãã®ããã©ã³ãã æ°ãçºçãããããã°ã©ã ã2種é¡ç´¹ä» è¶ ã·ã³ãã«ç ã¾ãã¯ãè¶ ã·ã³ãã«ãªãã®ãã $weighted_rand = mt_rand(1, mt_rand(1, 100)); ã¯ããããã ãã§ãã ã¨ãã£ã¦ãããª
ä¾ãã°MySQLã®ãã¼ã¿ãã¼ã¹ããWEBãµã¤ãä¸ã«ã©ã³ãã ã«ååæ å ±ãåºåæ å ±ãåå¾ãã¦ãï¼ï¼ä»¶ç¨åº¦è¡¨ç¤ºããããã¨ãããåç´ã«ãSELECT * FROM table ORDER BY RAND();ã使ç¨ãããã¨ãèããããããã©ã³ãã åå¾ããã¨å ¨ä»¶åå¾ã¨åãè² è·ããããã®ã§ããã¼ã¿ä»¶æ°ãæ°ä¸ä»¶ä»¥ä¸ãããããªå ´åå¦çããã©ã¼ãã³ã¹ãåé¡ã¨ãªãããããã£ã¦ãSELECT * FROM table ORDER BY RAND() limit 0, 10;ã¨ãã¦ï¼ï¼ä»¶ã©ã³ãã ã«åå¾ãããã¨ãã¦ãå ¨ä»¶åå¾ç¸å½ã®å¦çããã©ã¼ãã³ã¹ã¨ãªãå®ç¨çã§ã¯ãªããã対çãï¼ï¼åå¾ããã«ã©ã ãå°ãªãã®ã§ããã°ï¼ã§ã¯ãªãselect id,name,price from table order by rand() limit 0,10; ãªã©ã¨ããã¨ããªãæ©ãï¼ï¼ã©ã³ãã ã«âåãåãâãã¨ãã§ããã°ï¼ï¼ä»¶ã¯é£ç¶ã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}