Thinkphp framework wants to execute its own native sql, how to set up the execution! I'm new to this, thank you
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>
Read more manuals and refer to the manual
Agree with the first floor, query
and execute
execute sql
in
thinkphp