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

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

WBOY
WBOYOriginal
2016-06-06 20:34:301175browse

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

回复内容:

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

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

Statement:
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