<?phprequire_once ('connect.php');$sql="select * from table1;";$sql.="select id,username,age from user;";$mysqli->multi_query($sql);if($mysqli->multi_query($sql)){? ? do{? ? ? ? if($res=$mysqli->store_result()){ //use_result()或store_result()得到查詢的結(jié)果集? ? ? ? ? ? $rows[]=$res->fetch_all(MYSQLI_ASSOC);// ? ? ? ? ? ? mysql_free_result($res);? ? ? ? ? ? $res->free_result();? ? ? ? }? ? }while($mysqli->more_results()&&$mysqli->next_result());//more_result()檢測是否有更多的結(jié)果集,next_result()將結(jié)果集指針向下移動(dòng)一位}else{? ? echo $mysqli->error;}print_r($rows);$mysqli->close();?>結(jié)果顯示:Commands out of sync; you can't run this command now
添加回答
舉報(bào)
0/150
提交
取消