尊龙凯时人生就是博

ThinkPHPÖÐÔõô¾ÙÐÐÌõ¼þÅÌÎÊ

Ò»¡¢Ê¹ÓÃwhereÒªÁìÌí¼ÓÅÌÎÊÌõ¼þ

ÔÚThinkPHPÖУ¬ÅÌÎÊÌõ¼þ¿ÉÒÔʹÓÃwhereÒªÁìÀ´Ìí¼Ó¡£whereÒªÁìÓÐÁ½¸ö²ÎÊý£ºµÚÒ»¸ö²ÎÊýΪÅÌÎÊÌõ¼þ£¬µÚ¶þ¸ö²ÎÊýΪÅÌÎÊÌõ¼þµÄ°ó¶¨²ÎÊý¡£ÒªÅÌÎÊidΪ1»ò2µÄ¼Í¼£¬ÎÒÃÇ¿ÉÒÔÓÃÒÔÏ´úÂ룺

$map['id'] = array('eq',1);
$map['id'] = array('eq',2);
$data = M('table_name')->where($map)->select();

µÇ¼ºó¸´ÖÆ

ÎÒÃÇÏȵ¥¶À½ç˵ÁËÅÌÎÊÌõ¼þ£¬Ò»¸öÊÇidΪ1£¬ÁíÒ»¸öÊÇidΪ2£¬È»ºó½«ËüÃÇÌí¼Ó½ø$mapÊý×éÖС£È»ºóÎÒÃÇʹÓÃwhereÒªÁ콫Õâ¸öÊý×éת´ï¸øÅÌÎʲÙ×÷¡£ÅÌÎÊЧ¹û½«·µ»ØÇкÏÌõ¼þµÄ¼Í¼Êý×é¡£

¶þ¡¢Ê¹ÓÃÊý×é·½·¨×ª´ïÅÌÎÊÌõ¼þ

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»

³ýÁËÓÃwhereÒªÁ죬ÎÒÃÇÒ²¿ÉÒÔÓÃÊý×é·½·¨×ª´ïÅÌÎÊÌõ¼þ¡£Ê¹ÓÃÕâÖÖ·½·¨£¬ÎÒÃÇÖ»ÐèÒªÔÚ$mapÊý×éÖÐÌí¼ÓÅÌÎÊÌõ¼þ¼´¿É¡£ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏ´úÂëÀ´ÅÌÎʱíÖÐÄÄЩ¼Í¼µÄid¼´ÊÇ1»ò¼´ÊÇ2

$map['id'] = array('in', '1,2');
$data = M('table_name')->where($map)->select();

µÇ¼ºó¸´ÖÆ

ÎÒÃÇÔÚ´úÂëÖнç˵ÁËÅÌÎÊÌõ¼þ£¬½öÏÞÓÚ $map Êý×éÖÐµÄ id Ϊ 1 »ò 2¡£ÎÒÃÇʹÓÃÁË¡°in¡±ÔËËã·û£¬À´Í³Ò»¼ìË÷idΪ1»ò2µÄ¼Í¼¡£ÕâÑù£¬ÎÒÃǾͿÉÒÔÇáËɵØʵÏÖÉ趨¡°»ò¡±µÄÅÌÎÊÌõ¼þ¡£

Èý¡¢Ê¹ÓÃ×Ö·û´®Æ´½Ó

ÓÐʱ¼ä£¬ÎÒÃÇ¿ÉÒÔʹÓÃ×Ö·û´®Æ´½ÓµÄ·½·¨À´ÊµÏÖ¡°»ò¡±µÄÅÌÎÊÌõ¼þ¡£¾ÙÀý¶øÑÔ£¬ÈôÊÇÎÒÃÇÏëÒª¼ìË÷³ö¼ÈÖª×ãÌõ¼þAÓÖÖª×ãÌõ¼þBµÄ¼Í¼£¬¿ÉÒÔ½ÓÄÉÒÔÏ´úÂ룺

$map['×Ö¶ÎÃû'] = array('exp', '(Ìõ¼þA) OR (Ìõ¼þB)');
$data = M('table_name')->where($map)->select();

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊö´úÂëÖУ¬ÎÒÃÇʹÓÃexp²Ù×÷·ûת´ïÁËÒ»Ìõ°üÀ¨Á½¸öÌõ¼þµÄSQLÓï¾ä¡£×¢ÖØ£¬ÕâÀïÌõ¼þÐèҪʹÓÃÀ¨ºÅÀ¨ÆðÀ´ÒÔÈ·±£Âß¼­×¼È·¡£

ÒÔÉϾÍÊÇThinkPHPÖÐÔõô¾ÙÐÐÌõ¼þÅÌÎʵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ