//开启mysqli状态下
//只在SELECT下可用
$mysqli = new mysqli("host_name", "db_user", "db_passwrod", "db_name");
$query = "SELECT * FROM test";
$result = $mysqli->($query);
printf("影响了%d行",$result->num_rows);
//如果要返回INSERT、UPDATE、DELETE的受影响条数要用affected_rows
转载于:https://www.cnblogs.com/itime/archive/2012/07/24/2607146.html