该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
小弟是刚刚开始学习PHP 用的服务器 是 XmiServer v2.0_php5 在调试修改页面时遇到了下面错误信息,请各位大虾帮帮忙:
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in D:\usr\www\example\edit.php on line 47
Home
Add a new entry to the DataBase
Edit an entry
Delete an entry from the DataBase
下面是我的源代码:
Editing an entry from the databaseEdit an entry
mysql_connect(localhost,root,admin) or die ("Problem connecting to DataBase");
$query = "select * from tbl";
$result = mysql_db_query("example", $query);
if ($result)
{
echo "Found these entries in the database:
";
echo "
idx | User Name | Last Name | Free Text |
while ($r = mysql_fetch_array($result))
{
$idx = $r["idx"];
$user = $r["UserName"];
$last = $r["LastName"];
$text = $r["FreeText"];
echo "
$idx
$user$last$text";}
echo "
";}
else
{
echo "No data.";
}
mysql_free_result($result);
include ('links.x');
?>