×ðÁú¿­Ê±¹ÙÍøµÇ¼

thinkphp5ÔõôÉèÖñíǰ׺

Ò»¡¢Ê²Ã´ÊDZíǰ׺

ÔÚÒ»¸öÊý¾Ý¿âÖÐ £¬±íÃûÇ°ÃæµÄÀο¿×Ö·û»ò×Ö·û´®±»³ÆΪ±íǰ׺£¨table prefix£©¡£ºÃ±È˵ £¬ÎÒÃÇÔÚ¿ª·¢ThinkPHP5ÏîĿʱ £¬¿ÉÒÔÉèÖÃÒ»¸ö±íǰ׺Ϊ¡°tp_¡± £¬ÄÇôÔÚÊý¾Ý¿âÖÐ £¬ËùÓеıíÃû¶¼Ó¦¸ÃÒÔ¡°tp_¡±¿ªÍ·¡£

¶þ¡¢ÉèÖñíǰ׺

ÔÚThinkPHP5ÖÐ £¬ÉèÖñíǰ׺ÐèÒªÔÚÊý¾Ý¿âÉèÖÃÎļþ£¨Î»ÓÚÏîÄ¿¸ùĿ¼ÏµÄconfigĿ¼ÖеÄdatabase.phpÎļþ£©ÖоÙÐÐÉèÖá£ÏêϸµÄ²Ù×÷ÈçÏ£º

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

·­¿ªdatabase.phpÎļþ £¬ÕÒµ½connectionsÊý×éÖеÄdefaultÉèÖÃÏî¡£

ÔÚdefaultÉèÖÃÏîÖÐ £¬ÕÒµ½paramsÑ¡Ïî £¬È»ºó½«paramsµÄÖµÐÞ¸ÄΪÈçÏÂÃûÌãº

'params' => [
    // Êý¾Ý¿â±íǰ׺
    'prefix' => 'tp_',
],

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬’prefix’ => ‘tp_’ ÌåÏÖÊý¾Ý¿âÖеıíǰ׺Ϊ¡°tp_¡±¡£

3.ÉúÑÄÎļþ²¢ÖØÆôÏîÄ¿ £¬¼´¿ÉÀÖ³ÉÉèÖñíǰ׺¡£

ÖµµÃ×¢ÖصÄÊÇ £¬ÉèÖñíǰ׺ÐèÒªÔÚÉèÖÃÊý¾Ý¿âÅþÁ¬Ê± £¬¼´connectionsÊý×éÖеÄdefaultÉèÖÃÏîÖоÙÐС£×ÝÈ»ÄãÔÚÆäËûÅþÁ¬ÉèÖÃÖÐÖ¸¶¨Á˱íǰ׺ £¬Ò²»áÒòÕÒ²»µ½±í¶ø±¨´í¡£

±ðµÄ £¬ÔÚÉèÖÃÁ˱íǰ׺ºó £¬ÎÒÃÇÔÚ¾ÙÐÐÊý¾Ý±íÏà¹Ø²Ù×÷ʱ £¬ÐèÒªÔÚ±íÃûÇ°ÔöÌí¡°__TABLE_PREFIX__¡±±äÁ¿¡£ºÃ±È˵ £¬ÈôÊÇÎÒÃÇÒª²Ù×÷user±í £¬Ó¦¸ÃÕâÑùд£º

Db::name('__TABLE_PREFIX__user')->where('id', 1)->find();

µÇ¼ºó¸´ÖÆ

ͨ¹ýÉÏÊö´úÂë £¬³ÌÐò»á½«__TABLE_PREFIX__×Ô¶¯Ì滻ΪÎÒÃÇÔÚÊý¾Ý¿âÉèÖÃÎļþÖÐÉèÖõıíǰ׺¡£×ÝÈ»ÔÚͳһ̨ЧÀÍÆ÷ÉÏÔËÐжà¸öÓ¦ÓóÌÐò £¬Ò²²»»áÓÉÓÚ±íÃû³åÍ»¶ø±¬·¢ÎÊÌâ¡£

ÒÔÉϾÍÊÇthinkphp5ÔõôÉèÖñíǰ׺µÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

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

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

QR code
ÍøÕ¾µØͼ