Home > Backend Development > PHP Tutorial > thinkphp涉及到多表操作时怎么使用模型呢?

thinkphp涉及到多表操作时怎么使用模型呢?

WBOY
Release: 2016-06-06 20:34:30
Original
1193 people have browsed it

Model好像只是作用于一张表的,如果一条sql要操作多个表呢,表相互有依赖呢,用视图模型是吧,那如果一条sql可能同更新或删除多个表的行呢?

回复内容:

Model好像只是作用于一张表的,如果一条sql要操作多个表呢,表相互有依赖呢,用视图模型是吧,那如果一条sql可能同更新或删除多个表的行呢?

可以用你所说的视图模型http://www.kancloud.cn/manual/thinkphp/1781
一条语句是无法对多个表 做删除更新的~

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