gpt4 book ai didi

php查询无法找出问题

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

我没有收到错误,但它也没有返回行值。我该如何解决这个问题?

<?php 

//DATABASE
$dbConn = mysql_connect($host,$username,$password);
mysql_select_db($database,$dbConn);

$SQL = mysql_query("SELECT N.*, C.CatID FROM News N INNER JOIN Categories C ON N.CatID = C.CatID WHERE N.Active = 1 ORDER BY DateEntered DESC");


while ( $Result = mysql_fetch_array($SQL) or die(mysql_error())) {
$CatID[] = $Result[CatID];
$NewsName[] = $Result[NewsName];
$NewsShortDesc[] = $Result[NewsShortDesc];
}

// mysql_free_result($Result);


?>
<div class="toparticle">
<span class="section"><?=$CatID[0] ?> </span>
<span class="headline"><?=$NewsName[0] ?></span>
<p><?=$NewsShortDesc[0] ?></p>
</div>

最佳答案

$Result[CatID];

需要

$Result['CatID'];

while ( $Result = mysql_fetch_array($SQL) or die(mysql_error())) {

需要

while ( $Result = mysql_fetch_array($SQL)) {

关于php查询无法找出问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4676225/

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