无法弄清楚如何运行 mysqli_multi_query 并使用上次查询的结果

发布于 2024-10-12 05:29:13 字数 2077 浏览 3 评论 0原文

我以前从未使用过 mysqli_multi_query ,它让我难以置信,我在网上找到的任何例子都不能帮助我准确地弄清楚我想要做什么。

这是我的代码:

<?php

    $link = mysqli_connect("server", "user", "pass", "db");

    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }

    $agentsquery = "CREATE TEMPORARY TABLE LeaderBoard (
        `agent_name` varchar(20) NOT NULL,
        `job_number` int(5) NOT NULL,
        `job_value` decimal(3,1) NOT NULL,
        `points_value` decimal(8,2) NOT NULL
    );";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`, `job_number`, `job_value`, `points_value`) SELECT agent_name, job_number, job_value, points_value FROM jobs WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`) SELECT DISTINCT agent_name FROM apps WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "SELECT agent_name, SUM(job_value), SUM(points_value) FROM leaderboard GROUP BY agent_name ORDER BY SUM(points_value) DESC";

    $i = 0;
    $agentsresult = mysqli_multi_query($link, $agentsquery);

    while ($row = mysqli_fetch_array($agentsresult)){
        $number_of_apps = getAgentAppsWeek($row['agent_name'],$weeknum,$current_year);
        $i++;
?>

            <tr class="tr<?php echo ($i & 1) ?>">
                <td style="font-weight: bold;"><?php echo $row['agent_name'] ?></td>
                <td><?php echo $row['SUM(job_value)'] ?></td>
                <td><?php echo $row['SUM(points_value)'] ?></td>
                <td><?php echo $number_of_apps; ?></td>
            </tr>

<?php

    }
?>

我想做的就是运行多个查询,然后使用这 4 个查询的最终结果并将它们放入我的表中。

上面的代码实际上根本不起作用,我只是收到以下错误:

警告:mysqli_fetch_array() 需要 参数1为mysqli_result, 布尔值给出 C:\xampp\htdocs\Hydroboard\Hydro_reporting_2010.php 在第 391 行

什么帮助吗?

I've never used mysqli_multi_query before and it's boggling my brain, any examples I find on the net aren't helping me to figure out exactly what it is I want to do.

Here is my code:

<?php

    $link = mysqli_connect("server", "user", "pass", "db");

    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }

    $agentsquery = "CREATE TEMPORARY TABLE LeaderBoard (
        `agent_name` varchar(20) NOT NULL,
        `job_number` int(5) NOT NULL,
        `job_value` decimal(3,1) NOT NULL,
        `points_value` decimal(8,2) NOT NULL
    );";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`, `job_number`, `job_value`, `points_value`) SELECT agent_name, job_number, job_value, points_value FROM jobs WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`) SELECT DISTINCT agent_name FROM apps WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "SELECT agent_name, SUM(job_value), SUM(points_value) FROM leaderboard GROUP BY agent_name ORDER BY SUM(points_value) DESC";

    $i = 0;
    $agentsresult = mysqli_multi_query($link, $agentsquery);

    while ($row = mysqli_fetch_array($agentsresult)){
        $number_of_apps = getAgentAppsWeek($row['agent_name'],$weeknum,$current_year);
        $i++;
?>

            <tr class="tr<?php echo ($i & 1) ?>">
                <td style="font-weight: bold;"><?php echo $row['agent_name'] ?></td>
                <td><?php echo $row['SUM(job_value)'] ?></td>
                <td><?php echo $row['SUM(points_value)'] ?></td>
                <td><?php echo $number_of_apps; ?></td>
            </tr>

<?php

    }
?>

All I'm trying to do is run a multiple query and then use the final results from those 4 queries and put them into my tables.

the code above really doesn't work at all, I just get the following error:

Warning: mysqli_fetch_array() expects
parameter 1 to be mysqli_result,
boolean given in
C:\xampp\htdocs\hydroboard\hydro_reporting_2010.php
on line 391

any help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

同尘 2024-10-19 05:29:13

手册mysqli_multi_query() 返回一个 bool 指示成功。

要从第一个查询中检索结果集,您可以使用 mysqli_use_result() 或 mysqli_store_result()。所有后续查询结果都可以使用 mysqli_more_results() 和 mysqli_next_result() 进行处理。

这是一个返回多重查询的最后结果的函数:

function mysqli_last_result($link) {
    while (mysqli_more_results($link)) {
        mysqli_use_result($link); 
        mysqli_next_result($link);
    }
    return mysqli_store_result($link);
}

用法:

$link = mysqli_connect();

$query  = "SELECT 1;";
$query .= "SELECT 2;";
$query .= "SELECT 3";

mysqli_multi_query($link, $query);
$result = mysqli_last_result($link);
$row = $result->fetch_row();
echo $row[0];  // prints "3"

$result->free();
mysqli_close($link);

From the manual: mysqli_multi_query() returns a bool indicating success.

To retrieve the resultset from the first query you can use mysqli_use_result() or mysqli_store_result(). All subsequent query results can be processed using mysqli_more_results() and mysqli_next_result().

Here is a function that returns the last result of a multi-query:

function mysqli_last_result($link) {
    while (mysqli_more_results($link)) {
        mysqli_use_result($link); 
        mysqli_next_result($link);
    }
    return mysqli_store_result($link);
}

Usage:

$link = mysqli_connect();

$query  = "SELECT 1;";
$query .= "SELECT 2;";
$query .= "SELECT 3";

mysqli_multi_query($link, $query);
$result = mysqli_last_result($link);
$row = $result->fetch_row();
echo $row[0];  // prints "3"

$result->free();
mysqli_close($link);
最初的梦 2024-10-19 05:29:13

好吧,经过一些摆弄、试验和错误,并参考我在谷歌搜索中遇到的另一篇文章,我已经成功解决了我的问题!

这是新代码:

<?php

    $link = mysqli_connect("server", "user", "pass", "db");

    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }

    $agentsquery = "CREATE TEMPORARY TABLE LeaderBoard (
        `agent_name` varchar(20) NOT NULL,
        `job_number` int(5) NOT NULL,
        `job_value` decimal(3,1) NOT NULL,
        `points_value` decimal(8,2) NOT NULL
    );";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`, `job_number`, `job_value`, `points_value`) SELECT agent_name, job_number, job_value, points_value FROM jobs WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`) SELECT DISTINCT agent_name FROM apps WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "SELECT agent_name, SUM(job_value), SUM(points_value) FROM leaderboard GROUP BY agent_name ORDER BY SUM(points_value) DESC";

    mysqli_multi_query($link, $agentsquery) or die("MySQL Error: " . mysqli_error($link) . "<hr>\nQuery: $agentsquery");
    mysqli_next_result($link);
    mysqli_next_result($link);
    mysqli_next_result($link);

    if ($result = mysqli_store_result($link)) {
        $i = 0;
        while ($row = mysqli_fetch_array($result)){
            $number_of_apps = getAgentAppsWeek($row['agent_name'],$weeknum,$current_year);
            $i++;
?>

            <tr class="tr<?php echo ($i & 1) ?>">
                <td style="font-weight: bold;"><?php echo $row['agent_name'] ?></td>
                <td><?php echo $row['SUM(job_value)'] ?></td>
                <td><?php echo $row['SUM(points_value)'] ?></td>
                <td><?php echo $number_of_apps; ?></td>
            </tr>

<?php

        }
    }
?>

在为每个查询多次粘贴 mysqli_next_result 后,它神奇地工作了!耶!我明白它为什么有效,因为我告诉它跳到下一个结果 3 次,所以它跳到查询 #4 的结果,这是我想要使用的结果。

不过,对我来说似乎有点笨重,应该只有一个类似 mysqli_last_result($link) 之类的命令,或者如果你问我的话......

感谢 rik 和 f00 的帮助,我最终到达了那里:)

Okay after some fiddling around, trial and error and taking reference from another post that I came across in a Google search I've managed to solve my problem!

Here's the new code:

<?php

    $link = mysqli_connect("server", "user", "pass", "db");

    if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        exit();
    }

    $agentsquery = "CREATE TEMPORARY TABLE LeaderBoard (
        `agent_name` varchar(20) NOT NULL,
        `job_number` int(5) NOT NULL,
        `job_value` decimal(3,1) NOT NULL,
        `points_value` decimal(8,2) NOT NULL
    );";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`, `job_number`, `job_value`, `points_value`) SELECT agent_name, job_number, job_value, points_value FROM jobs WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "INSERT INTO LeaderBoard (`agent_name`) SELECT DISTINCT agent_name FROM apps WHERE YEAR(booked_date) = $current_year && WEEKOFYEAR(booked_date) = $weeknum;";
    $agentsquery .= "SELECT agent_name, SUM(job_value), SUM(points_value) FROM leaderboard GROUP BY agent_name ORDER BY SUM(points_value) DESC";

    mysqli_multi_query($link, $agentsquery) or die("MySQL Error: " . mysqli_error($link) . "<hr>\nQuery: $agentsquery");
    mysqli_next_result($link);
    mysqli_next_result($link);
    mysqli_next_result($link);

    if ($result = mysqli_store_result($link)) {
        $i = 0;
        while ($row = mysqli_fetch_array($result)){
            $number_of_apps = getAgentAppsWeek($row['agent_name'],$weeknum,$current_year);
            $i++;
?>

            <tr class="tr<?php echo ($i & 1) ?>">
                <td style="font-weight: bold;"><?php echo $row['agent_name'] ?></td>
                <td><?php echo $row['SUM(job_value)'] ?></td>
                <td><?php echo $row['SUM(points_value)'] ?></td>
                <td><?php echo $number_of_apps; ?></td>
            </tr>

<?php

        }
    }
?>

after sticking mysqli_next_result in there multiple times for each query it magically worked! yay! I understand why it works, because i'm telling it to skip to the next result 3 times, so it skips to the result for query #4 which is the one i want to use.

Seems a bit clunky to me though, there should just be a command for something like mysqli_last_result($link) or something if you ask me...

Thanks for the help rik and f00, I got there eventually :)

轮廓§ 2024-10-19 05:29:13

我将通过创建一个存储过程来简化您尝试执行的操作,该存储过程将生成领导者/代理统计信息,然后从您的 php (单个调用)中调用它,如下所示:

完整脚本此处: http://pastie.org/1451802

或者,您可以将各个查询合并到单个 select/group by 语句中。

请参阅此处: http://pastie.org/1451842

select
 leaders.agent_name, 
 sum(leaders.job_value) as sum_job_value, 
 sum(leaders.points_value) as sum_points_value 
from
(
select 
 agent_name, 
 job_number, 
 job_value, 
 points_value 
from 
 jobs 
where 
 year(booked_date) = 2011 and weekofyear(booked_date) = 2
union all
select distinct
 agent_name,
 0,0,0
from
 apps
where 
 year(booked_date) = 2011 and weekofyear(booked_date) = 2
) leaders
group by
 agent_name 
order by sum_points_value desc;

存储过程

drop procedure if exists list_leaders;

delimiter #
create procedure list_leaders
(
in p_year smallint unsigned,
in p_week tinyint unsigned
)
begin

  create temporary table tmp_leaders(
    agent_name varchar(20) not null,
    job_number int unsigned not null default 0, -- note the default values
    job_value decimal(3,1) not null default 0,
    points_value decimal(8,2) not null default 0
  )engine=memory;

  insert into tmp_leaders (agent_name, job_number, job_value, points_value) 
    select agent_name, job_number, job_value, points_value from jobs 
    where year(booked_date) = p_year and weekofyear(booked_date) = p_week;

  insert into tmp_leaders (agent_name) -- requires default values otherwise you will get nulls
    select distinct agent_name from apps
    where year(booked_date) = p_year and weekofyear(booked_date) = p_week;

  select 
    agent_name, 
    sum(job_value) as sum_job_value, 
    sum(points_value) as sum_points_value 
   from
    tmp_leaders
   group by
    agent_name order by sum_points_value desc;

  drop temporary table if exists tmp_leaders;

end#

delimiter ;

call list_leaders(year(curdate()), weekofyear(curdate()));

PHP 脚本

<?php

ob_start(); 

try
{
    $db = new mysqli("localhost", "foo_dbo", "pass", "foo_db", 3306);

    if ($db->connect_errno) 
        throw new exception(sprintf("Could not connect: %s", $db->connect_error));

    $sqlCmd = "call list_leaders(2011, 2)";
    $result = $db->query($sqlCmd);

    if(!$result) throw new exception(sprintf("Invalid query : %s", $sqlCmd));

    if($db->affected_rows <= 0){
        echo "no leaders found !";
    }
    else{
        $leaders = $result->fetch_all(MYSQLI_ASSOC);
        foreach($leaders as $ldr){
            // do stuff
            echo $ldr["agent_name"], "<br/>";
        }
    }
}
catch(exception $ex)
{
    ob_clean(); 
    echo sprintf("zomg borked - %s", $ex->getMessage());
}

if(!$db->connect_errno) $db->close();
ob_end_flush();
?>

现在更简单了 - 希望它有所帮助:)

I would simplify what you're trying to do by creating a stored procedure which will produce the leader/agent stats and then just call it from your php (single call) as follows:

full script here : http://pastie.org/1451802

alternatively, you could probably combine your individual queries into a single select/group by statement.

see here : http://pastie.org/1451842

select
 leaders.agent_name, 
 sum(leaders.job_value) as sum_job_value, 
 sum(leaders.points_value) as sum_points_value 
from
(
select 
 agent_name, 
 job_number, 
 job_value, 
 points_value 
from 
 jobs 
where 
 year(booked_date) = 2011 and weekofyear(booked_date) = 2
union all
select distinct
 agent_name,
 0,0,0
from
 apps
where 
 year(booked_date) = 2011 and weekofyear(booked_date) = 2
) leaders
group by
 agent_name 
order by sum_points_value desc;

Stored procedure

drop procedure if exists list_leaders;

delimiter #
create procedure list_leaders
(
in p_year smallint unsigned,
in p_week tinyint unsigned
)
begin

  create temporary table tmp_leaders(
    agent_name varchar(20) not null,
    job_number int unsigned not null default 0, -- note the default values
    job_value decimal(3,1) not null default 0,
    points_value decimal(8,2) not null default 0
  )engine=memory;

  insert into tmp_leaders (agent_name, job_number, job_value, points_value) 
    select agent_name, job_number, job_value, points_value from jobs 
    where year(booked_date) = p_year and weekofyear(booked_date) = p_week;

  insert into tmp_leaders (agent_name) -- requires default values otherwise you will get nulls
    select distinct agent_name from apps
    where year(booked_date) = p_year and weekofyear(booked_date) = p_week;

  select 
    agent_name, 
    sum(job_value) as sum_job_value, 
    sum(points_value) as sum_points_value 
   from
    tmp_leaders
   group by
    agent_name order by sum_points_value desc;

  drop temporary table if exists tmp_leaders;

end#

delimiter ;

call list_leaders(year(curdate()), weekofyear(curdate()));

PHP script

<?php

ob_start(); 

try
{
    $db = new mysqli("localhost", "foo_dbo", "pass", "foo_db", 3306);

    if ($db->connect_errno) 
        throw new exception(sprintf("Could not connect: %s", $db->connect_error));

    $sqlCmd = "call list_leaders(2011, 2)";
    $result = $db->query($sqlCmd);

    if(!$result) throw new exception(sprintf("Invalid query : %s", $sqlCmd));

    if($db->affected_rows <= 0){
        echo "no leaders found !";
    }
    else{
        $leaders = $result->fetch_all(MYSQLI_ASSOC);
        foreach($leaders as $ldr){
            // do stuff
            echo $ldr["agent_name"], "<br/>";
        }
    }
}
catch(exception $ex)
{
    ob_clean(); 
    echo sprintf("zomg borked - %s", $ex->getMessage());
}

if(!$db->connect_errno) $db->close();
ob_end_flush();
?>

Kinda simpler now - hope it helps :)

断肠人 2024-10-19 05:29:13

将结果存储在变量中并最终使用该变量。

    do{
        if($result = $con->store_result()){
            $data=$result->fetch_all();
            $result->free();
        }
    } while($con->more_results()&&$con->next_result());
    echo(json_encode($data));

Store result in a variable and in the end use that variable.

    do{
        if($result = $con->store_result()){
            $data=$result->fetch_all();
            $result->free();
        }
    } while($con->more_results()&&$con->next_result());
    echo(json_encode($data));
安静被遗忘 2024-10-19 05:29:13

我想整理海报目前接受的解决方案,使其与我认为的最佳实践更加一致。

  • 虽然多行 mysqli_next_result($link) 给出了预期的结果,但它看起来有点黑客。所以我将在他们的位置创建一个 DO-WHILE。
  • rik 涉及创建函数 mysqli_last_result($link) 的解决方案是多余的。我的 WHILE 条件将实现相同的效果。此外,rik 的代码混合了过程和面向对象的风格,这是应该避免的。
  • 我不会在 php 和 html 之间来回切换。
  • 我将稍微调整一下班级切换。
  • 我将直接内嵌 getAgentAppsWeek(),因为我不喜欢创建只提到一次的变量;因为 Harry Weinert 为函数命名做得很好。
  • 我认为这更容易阅读。

    if(mysqli_multi_query($link,$agentsquery)){
        做{
            if($result=mysqli_store_result($link)){ // 如果没有记录集则忽略
                while($row=mysqli_fetch_array($结果)){
                    echo "";
                        echo "",$row['agent_name'],"";
                        echo "",$row['SUM(job_value)'],"";
                        echo "",$row['SUM(points_value)'],"";
                        echo "",getAgentAppsWeek($row['agent_name'],$weeknum,$current_year),"";
                    回声“”;
                }
                mysqli_free_result($结果);
            }
        while(mysqli_more_results($link) && mysqli_next_result($link));
    }
    如果($error_mess=mysqli_error($link)){
        echo "错误: $error_mess";
    }
    //如果任何查询返回 false,mysqli_multi_query 将停止
    // 并且将提供要归咎的单个查询错误。
    

I'd like to tidy up the poster's currently accepted solution to align it more with what I consider to be best practice.

  • While multiple lines of mysqli_next_result($link) gives the intended result, it looks a bit hackish. So I'm going to create a DO-WHILE in their place.
  • rik's solution involving the creation of function mysqli_last_result($link) is superfluous. My WHILE condition will accomplish the same effect. Additionally, rik's code mixes procedural and object oriented styles, which should be avoided.
  • I won't bounce around between php and html.
  • I'll just tweak the class toggle a little.
  • I'll put getAgentAppsWeek() directly inline, as I don't like to create variables that are only mentioned one time; and because Harry Weinert did a good job of naming the function.
  • IMO this is just easier to read.

    if(mysqli_multi_query($link,$agentsquery)){
        do{
            if($result=mysqli_store_result($link)){ // ignore if no record set
                while($row=mysqli_fetch_array($result)){
                    echo "<tr class=\"tr",(++$i & 1),"\">";
                        echo "<td style=\"font-weight:bold;\">",$row['agent_name'],"</td>";
                        echo "<td>",$row['SUM(job_value)'],"</td>";
                        echo "<td>",$row['SUM(points_value)'],"</td>";
                        echo "<td>",getAgentAppsWeek($row['agent_name'],$weeknum,$current_year),"</td>";
                    echo "</tr>";
                }
                mysqli_free_result($result);
            }
        } while(mysqli_more_results($link) && mysqli_next_result($link));
    }
    if($error_mess=mysqli_error($link)){
        echo "<tr class=\"error\"><td colspan=\"4\">Error: $error_mess</td></tr>";
    }
    //if any query returns false, mysqli_multi_query will stop
    // and the individual query error to blame will be provided.
    
埋情葬爱 2024-10-19 05:29:13

我想我也会对这个问题表示赞同(嘿,这仍然是程序性的,而且都是爵士乐)。这并不是万无一失的,但我已经与 MySQLi 进行过斗争,它是一群与 multi_query 相关的快乐的人,但我无法让它按照我想要的方式很好地发挥作用,或者具有我需要的灵活性。我看到了几个例子,其中一些程序员只是简单地运行 explode(';', $sql_statements) 这让我的眼睛流血,因为这是多么可怕的错误。

我的解决方案可能不适合你,但这对我有用。 (不,它也不是防弹的,但适合我的特定应用程序)。

<?php
    $file = file_get_contents('test_multiple_queries.sql');
    $result = preg_split("/;(?=\s*(create|insert|update|alter|show|explain|truncate|drop|delete|replace|start|lock|commit|rollback|set|begin|declare|rename|load|begin|describe|help))/im", $file);
    $result = array_map('trim', $result);

    foreach($result as $sql_query) {

        // Procedural style
        $my_query = mysqli_query($link, $sql_query);

        // Now you can get errors easily, or affected_rows, or whatever
        //    using much simpler, readable code
        mysqli_error($link);
        mysqli_affected_rows($link);

        // or go crazy with some other stuff
        $words = preg_split("/\s+/", $sql_query);
        switch(strtolower($words[0])) {
            case 'insert':
                // do something nifty like...
                echo 'New ID: '.mysqli_insert_id($link)."\n";
                break;
            case 'drop':
                // obviously run this before the query, simply here for example
                echo 'Hey young (man|lady)! We don\'t drop anything!';
                break;
            case 'select':
                // hooray for selecting stuff
                while($rs = mysqli_fetch_assoc($my_query)) {
                    // have fun with data
                }
                break;
        }
    }

I suppose I'll throw my hat in the ring on this question too (and hey it's still procedural and all that jazz). This is not fool proof, but I have fought and fought with MySQLi and it's band of merry men involved with multi_query and I couldn't get it to play nicely the way I wanted to, or have the flexibility that I needed. I saw several examples where some programmers were simply running explode(';', $sql_statements) which made my eyes bleed with how horribly wrong that can be.

My solution may not work for you, but this worked for me. (no it's not bulletproof either, but does the job for my particular application).

<?php
    $file = file_get_contents('test_multiple_queries.sql');
    $result = preg_split("/;(?=\s*(create|insert|update|alter|show|explain|truncate|drop|delete|replace|start|lock|commit|rollback|set|begin|declare|rename|load|begin|describe|help))/im", $file);
    $result = array_map('trim', $result);

    foreach($result as $sql_query) {

        // Procedural style
        $my_query = mysqli_query($link, $sql_query);

        // Now you can get errors easily, or affected_rows, or whatever
        //    using much simpler, readable code
        mysqli_error($link);
        mysqli_affected_rows($link);

        // or go crazy with some other stuff
        $words = preg_split("/\s+/", $sql_query);
        switch(strtolower($words[0])) {
            case 'insert':
                // do something nifty like...
                echo 'New ID: '.mysqli_insert_id($link)."\n";
                break;
            case 'drop':
                // obviously run this before the query, simply here for example
                echo 'Hey young (man|lady)! We don\'t drop anything!';
                break;
            case 'select':
                // hooray for selecting stuff
                while($rs = mysqli_fetch_assoc($my_query)) {
                    // have fun with data
                }
                break;
        }
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文