Home > Backend Development > PHP Tutorial > YII2-数据库查询操作

YII2-数据库查询操作

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:16:47
Original
1566 people have browsed it

YII2中有没有像TP方法中的 M 函数那样,不需要在models文件里创建该表的模型类也能进行对数据库中的表进行操作

回复内容:

YII2中有没有像TP方法中的 M 函数那样,不需要在models文件里创建该表的模型类也能进行对数据库中的表进行操作

<code>use yii\db\Query;
$users = (new Query())->from('user')->all();</code>
Copy after login

YII2 我没看到提供专业的M函数,具体YII操作数据库方法可以看看下面网页:
http://www.cnblogs.com/rhythmK/p/5135476.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template