save($data,array('where'=>"shengcunqi = '0000-00-00 00:0">
Home > Backend Development > PHP Tutorial > thinkphp 小弟我执行了一条更新语句 想要获取到影响的行数

thinkphp 小弟我执行了一条更新语句 想要获取到影响的行数

WBOY
Release: 2016-06-13 10:56:51
Original
1236 people have browsed it

thinkphp 我执行了一条更新语句 想要获取到影响的行数
例子:

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->$book = M('Book');$data = array();$data['shengCunQi'] = time();$book->save($data,array('where'=>"shengcunqi = '0000-00-00 00:00:00'",'limit'=>'17'));//我想获取到这条语句所影响到的行数. 也就是说: 我要获取到 我一共更新了多少条语句.
Copy after login


------解决方案--------------------
PHP code
$book = M('Book');$data = array();$data['shengCunQi'] = time();$result = $book->save($data,array('where'=>"shengcunqi = '0000-00-00 00:00:00'",'limit'=>'17'));var_dump($result); //$result将返回你所影响的行数或false<div class="clear">
                 
              
              
        
            </div>
Copy after login
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