我這邊按照上面的步驟還是找不到表,不管加不加數(shù)據(jù)庫(kù)名,都會(huì)出現(xiàn)數(shù)據(jù)庫(kù)中無(wú)法找到 active record class "Merchant" 對(duì)應(yīng)的 table "{{piao_userdb.merchant}}".繼承<?phpclass merchant extends MYActiveRecord{public function tableName(){return '{{piao_userdb.merchant}}';}public static function model($className=__CLASS__){return parent::model($className);}}控制器使用$merchant=new merchant();$list=$merchant->findAll();var_dump($list);報(bào)錯(cuò)include(MYActiveRecord.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory}
要使用YII框架連接多個(gè)數(shù)據(jù)庫(kù),怎么實(shí)現(xiàn)使用model,不要原始sql操作?
達(dá)令說(shuō)
2022-05-07 13:09:32