PHP中使用YII框架的問(wèn)題
1 回答

Helenr
TA貢獻(xiàn)1780條經(jīng)驗(yàn) 獲得超4個(gè)贊
因?yàn)槟鉛sers Model的對(duì)應(yīng)的表明沒(méi)改,在這個(gè)Users模型類(lèi)里,有這樣的方法:
public static function tableName()
{
return '{{%users1}}'; // users1是你的新表名
}
而且直接執(zhí)行Sql查詢(xún),好像不是這樣用的吧?
我一般都是這樣的
Yii::$app->getDb()->createCommand($sql)->queryAll()
Yii::$app->getDb()->createCommand($sql)->queryOne()
Yii::$app->getDb()->createCommand($sql)->excute()
....
- 1 回答
- 0 關(guān)注
- 749 瀏覽
添加回答
舉報(bào)
0/150
提交
取消