此功能可以在本CMS中調(diào)用其他任意網(wǎng)站或任意數(shù)據(jù)的內(nèi)容,方法如下:
1、打開(kāi)文件/config/database.php配置外部數(shù)據(jù)源的數(shù)據(jù)庫(kù)信息。
$db['dbsource1'] = array( 'dsn' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => 'root', 'port' => '3306', 'database' => 'database_name', 'dbdriver' => 'mysqli', 'dbprefix' => 'dr_', 'pconnect' => FALSE, 'db_debug' => TRUE, 'cache_on' => FALSE, 'cachedir' => 'cache/sql/', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'autoinit' => FALSE, 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), );
2、使用list標(biāo)簽調(diào)用
{list action=sql db=dbsource1 sql='select * from aaa'} ......... {/list}
以上標(biāo)簽就是調(diào)用外部數(shù)據(jù)的語(yǔ)法
文檔最后更新時(shí)間:2017-09-28 10:54:57