01 2017 档案
yii打印sql
摘要:想打印Sql的话,可以用把你要执行的命令例如queryAll(),queryOne(),execute()换成getRawSql(); 例如 : 要看$result = Yii::$app->db->createCommand()->update('table', ['name' => $name] 阅读全文
posted @ 2017-01-02 20:54 逆流成性 阅读(2255) 评论(0) 推荐(0)
yii使用createCommand()增删改查
摘要:查询单条数据$sql = "SELECT `name` FROM `table` WHERE id='7'";$users=Yii::$app->db->createCommand($sql)->queryOne();查询多条$sql = "SELECT `name` FROM `table` WH 阅读全文
posted @ 2017-01-02 20:47 逆流成性 阅读(7865) 评论(0) 推荐(0)