Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\wamp\www\bbs1\list.php on line 8
<?php
include("conn.php");
?>
<table width=500 border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#add3ef">
<?
$sql="select * form message order by id desc";
$query=mysql_query($sql);
while($row=mysql_fetch_array($query) ){
?>
<tr bgcolor="#eff3ff">
<td>标题:<?=$row[title]?> 用户: <?=$row[user]?></td>
</tr>
<tr bgcolor="#ffffff">
<td>内容:<?=$row[content]?></td>
</tr>
<?
}
?>
</table>
帮下忙 谢谢了
åå æ¯SQLæ§è¡ä¸è¯æ³é误äºï¼ä¿®æ¹ä¸é¢çè¯å¥ï¼
$sql="select * form message order by id desc";
$query=mysql_query($sql);
为ï¼
$sql="select * form message order by id desc";
$query=mysql_query($sql);
if (!$query) echo "SQLé误ï¼".mysql_error();
å°±å¯ä»¥è¿è¡æ¶æ¾ç¤ºå ·ä½é误çåå ã
ä½ è¿ä¸ªç¨åºçé误å¯è½æ¯æ²¡æéæ©æ°æ®åºï¼æ¯å¦æ°æ®åºæ¯testï¼é£ä¹åºè¯¥å¨mysql_queryä¹åå¢å ä¸é¢çè¯å¥ï¼
mysql_select_db('test');
$sql="select * form message order by id desc";
$query=mysql_query($sql);
为ï¼
$sql="select * form message order by id desc";
$query=mysql_query($sql);
if (!$query) echo "SQLé误ï¼".mysql_error();
å°±å¯ä»¥è¿è¡æ¶æ¾ç¤ºå ·ä½é误çåå ã
ä½ è¿ä¸ªç¨åºçé误å¯è½æ¯æ²¡æéæ©æ°æ®åºï¼æ¯å¦æ°æ®åºæ¯testï¼é£ä¹åºè¯¥å¨mysql_queryä¹åå¢å ä¸é¢çè¯å¥ï¼
mysql_select_db('test');
温馨提示:答案为网友推荐,仅供参考
第1个回答 2020-04-18
sql语法错误
$sql
=
mysql_query("select
*
from
`Out_Check`");
$info
=
mysql_fetch_array($aql);
改成:
$sql
=
mysql_query("select
*
from
`Out_Check`
where
1");
$info
=
mysql_fetch_array($sql);
你下面也有错误:
$info
=
mysql_fect_array($sql);
改成
mysql_fetch_array();
//fetch单词写错
$sql
=
mysql_query("select
*
from
`Out_Check`");
$info
=
mysql_fetch_array($aql);
改成:
$sql
=
mysql_query("select
*
from
`Out_Check`
where
1");
$info
=
mysql_fetch_array($sql);
你下面也有错误:
$info
=
mysql_fect_array($sql);
改成
mysql_fetch_array();
//fetch单词写错
第2个回答 2018-05-23
$sql="select * from message order by id desc";