W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
作用:獲取數(shù)據(jù)庫(kù)結(jié)構(gòu)配置。
語(yǔ)法: mixed database([string $table][, $with_attr])
參數(shù):
$table
設(shè)置將要獲取的表$with_attr
同時(shí)獲取字段屬性返回值:
$table
參數(shù),則返回只包含字段名的索引數(shù)組,不存在則返回 null
。$table
和 $with_attr
參數(shù),則返回表字段及其屬性構(gòu)成的索引數(shù)組,不存在則返回 null
。說(shuō)明:
在配置目錄中,與 database()
函數(shù)相關(guān)聯(lián)的是 database.php
文件,在第一次調(diào)用 database()
函數(shù)時(shí),系統(tǒng)會(huì)將 database.php
文件所返回的配置數(shù)組填充到 database()
函數(shù)中。
示例:
<?php
print_r(database()); //打印數(shù)據(jù)庫(kù)結(jié)構(gòu)
print_r(database('user')); //打印用戶表,但不包含字段屬性
print_r(database('user', true)); //打印用戶表,同時(shí)包含字段屬性
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: