【php开源代码栏目提醒】:网学会员在php开源代码频道为大家收集整理了code7.33.php提供大家参考,希望对大家有所帮助!
<?php
$con = mysqli_connect("localhost","root","0");
if(!$con)
{
echo "连接MySQL数据库出错原因:".mysqli_connect_error();
}
$con->select_db("db_student");
$query = "select ID, name from student;";
$query .= "select sex, count(*) from student group by sex ";
echo "<table><tr>";
$i=1;
if(mysqli_multi_query($con,$query))
{
do
{
$result =my
sqli_store_result($con);
echo "<td valign='top'><li>现在执行的是多个查询语句中的第".$i."个
查询语句:</li><br/>";
while ($row =
mysqli_fetch_row($result))
{
echo $row[0]."——".$row[1]."<br/>";
}
if(mysqli_more_results($con))
{
$i++;
echo "</td>";
}
}while (mysqli_next_result($con));
}
echo "</tr></table>";
mysqli_close($con);
?>