Newbie, please ask about thinkphp executing sql problem

WBOY
Release: 2016-08-18 09:15:44
Original
982 people have browsed it

Thinkphp framework wants to execute its own native sql, how to set up the execution! I'm new to this, thank you

Reply content:

Thinkphp framework wants to execute its own native sql, how to set up the execution! I'm new to this, thank you

To execute the native sql written by yourself, you can instantiate it directly using query() or execute(). Note that generally execute() is used for inserting and updating. Examples are as follows

<code>$model = new \Think\Model();

$model->query("SELECT ......"); //查询

$model->execute("INSERT ....."); //插入

$model->execute("UPDATE ....."); //更新</code>
Copy after login

Read more manuals and refer to the manual

Agree with the first floor, query and execute execute sql in thinkphp

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!