【发布时间】:2013-12-21 02:43:02
【问题描述】:
我在 PHP 中不断收到错误“Resource id #26”:
$R = mysql_query("SELECT * FROM Replies WHERE tid='$gS->ID' ORDER BY ID DESC LIMIT 1");
?>
<tr style="<? echo "$scss"; ?>">
<td width="560" class="thread" colspan="4" height="70" style="" border-left: 1px solid gainsboro;text-align: center;"><center><a href="./Post.php?id="><? echo "$gS->Title"; ?></center></a>
<td width="100" align="center" class="thread" style="text-align: center;" valign="middle"><? echo "$R"; ?></td>
<td width="100" align="center" class="thread" valign="middle"></td>
<td width="200" class="thread" style="border-right: 1px solid gainsboro;">by <? echo "$LastReply"; ?> <br>January, 1st, 2000 - 2:00am</td>
</tr>
</table>
【问题讨论】:
-
mysql_query不返回任何值。你仍然需要_fetch_xy()他们。 -
您正在回显您的记录集。你可能想要
mysql_fetch_array()或类似的。