参考链接:http://php.net/manual/en/mysqli.affected-rows.php
/* update rows */ $mysqli->query("UPDATE Language SET Status=1 WHERE Percentage > 50"); printf("Affected rows (UPDATE): %d ", $mysqli->affected_rows);
注意,一下写法是错误的:
$query="insert into eventtable (projectid,classname,object,username)values(2,'config','A.0.0,1','王五')"; $result=$mysqli->query($query);//此时,$result 是bool值 echo $result->affected_rows;//错误