//开启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