Home > Backend Development > PHP Tutorial > Major discovery of the BUG in the name prefix of the cross-database mapping relationship table in the Discuz DB layer, discuz relationship table_PHP tutorial

Major discovery of the BUG in the name prefix of the cross-database mapping relationship table in the Discuz DB layer, discuz relationship table_PHP tutorial

WBOY
Release: 2016-07-13 10:20:51
Original
1371 people have browsed it

Major discovery of discuz DB layer cross-database mapping relationship table name prefix BUG, ​​discuz relationship table

Scenario:

Create a Table model in Discuz, but the Table is not in the same library as Discuz.

Discuz seems to provide a cross-library mapping mechanism after version 3.

There is no problem with the mapping. The main reason is that the table name prefix is ​​not mapped accordingly. Of course, it's not actually a bug. Because he only considers discuz's own system, generally speaking, the table name prefixes are the same.

In the db driver class, db_driver_mysql(i):

Append code to function table_name

<span>if</span>(!<span>empty</span>(<span>$this</span>->config[<span>$id</span>]['tablepre'<span>])){
                </span><span>$this</span>->tablepre = <span>$this</span>->config[<span>$id</span>]['tablepre'<span>];
            }</span>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/864310.htmlTechArticleMajor discovery of Discuz DB layer cross-database mapping relationship table name prefix BUG, ​​discuz relationship table scenario: Create Table in Discuz model, but the library where the Table is located is not in the same library as Discuz. Discuz seems to be...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template