gpt4 book ai didi

mysql_fetch_array (MYSQL)

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

我是初学者,我有一个错误

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\VertrigoServ\www\index.php on line 35

和代码...

$sresult = mysql_query("SELECT code, location FROM banners");
while ($row_s = mysql_fetch_array($sresult))
{
$banner[$row_s["location"]]=$row_s["code"];
}

最佳答案

试试这个

$sresult = mysql_query("SELECT code, location FROM banners");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
while ($row_s = mysql_fetch_array($sresult))
{
$banner[$row_s["location"]]=$row_s["code"];
}

并检查错误是什么。

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

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