gpt4 book ai didi

php - Mysql-php mysql_fetch_array()

转载 作者:行者123 更新时间:2023-11-29 14:03:10 25 4
gpt4 key购买 nike

        $avg_pgt = mysql_query("SELECT avg(convert(custom_var_v1,unsigned)),min(convert(custom_var_v1,unsigned)), max(convert(custom_var_v1,unsigned) FROM `table_name` WHERE server_time BETWEEN '$date 00:00:00' AND '$date 23:59:59'");

$row_all = mysql_fetch_array($avg_pgt);
$string_avg = (string)$row_all[0];
echo $string_avg;

它给出了一个错误mysql_fetch_array()期望参数1是代码中给出的资源 bool 值

最佳答案

max(convert(custom_var_v1,unsigned)

最后缺少一个),这可以工作:

    $avg_pgt = mysql_query("SELECT avg(convert(custom_var_v1,unsigned)),min(convert(custom_var_v1,unsigned)), max(convert(custom_var_v1,unsigned)) FROM `table_name` WHERE server_time BETWEEN '$date 00:00:00' AND '$date 23:59:59'");

$row_all = mysql_fetch_array($avg_pgt);
$string_avg = (string)$row_all[0];
echo $string_avg;

关于php - Mysql-php mysql_fetch_array(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14768556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com