gpt4 book ai didi

php - 警告 : mysql_fetch_array(): supplied argument is not a valid MySQL result resource

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

<分区>

Possible Duplicate:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result

这是我遇到问题的脚本部分。以下所有查询均有效,结果在 page 上正确显示除了 $sType="rating"。这是导致警告出现在数据位置的原因。我试过在服务器上运行特定查询,它正确返回。当我在网页上使用它时,它只会给我一个错误。有谁知道可能是什么问题?

$sType=$_GET["sort"];
$newQuery;
if($sType=="lowHigh")
{
$newQuery = mysql_query("SELECT * FROM Products ORDER BY SalePrice");
}
else if($sType=="highLow")
{
$newQuery = mysql_query("SELECT * FROM Products ORDER BY SalePrice DESC");
}
else if($sTpye=="rating")
{
$newQuery = mysql_query("SELECT * FROM Products ORDER BY Rating DESC, NumRatings DESC") or die(mysql_error());

}
else if($sType=="mostReviews")
{
$newQuery = mysql_query("SELECT * FROM Products ORDER BY NumRatings DESC");
}
$p1=mysql_fetch_array($newQuery);
$p2=mysql_fetch_array($newQuery);
$p3=mysql_fetch_array($newQuery);
$p4=mysql_fetch_array($newQuery);
$p5=mysql_fetch_array($newQuery);
$p6=mysql_fetch_array($newQuery);
$p7=mysql_fetch_array($newQuery);
$p8=mysql_fetch_array($newQuery);

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