我只是一个初学者,只是尝试从一个db.there读取数据是2个文件,一个是包含db连接代码的文件,另一个是我给出的code.In db的第二部分,在这里有3列: 1.id、2.name和3.说明当我试图打开火狐中的定位文件夹时
“致命错误:调用C:\xampp\htdocs\www\ connection\index.php中的未定义函数connection\index.php()”
8 num线是
同时($person=mysql_fetch_arrey($result))
我被选中"mysql_fetch_arrey($result)“和"$mysql_fetch_arrey($result)”
但这表明
“致命错误:函数名必须是第8行C:\xampp\htdocs\www\ connection\index.php中的字符串”
我使用adobe dreamwaver5和xampp服务器。
第一页:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>connection</title>
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$db = 'db_connection';
$conn = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($db);
?>
</body>
</html>
</body>
</html>第2页:
<?php
include 'connection.php';
$query = "SELECT * FROM people";
$result = mysql_query($query);
while($person = $mysql_fetch_arrey($result))
{
echo "<h3>".$person['name']."</h3>";
echo "<p>".$person['description']."</p>";
}
?>发布于 2011-06-27 09:55:03
函数的名称是数组,而不是mysql_fetch_arrey。所以while循环应该喜欢:
while($person = $mysql_fetch_array($result)) {
....
}发布于 2011-06-27 09:53:46
错误在这里,$mysql_fetch_arrey
这应该是
while($person = mysql_fetch_array($result))https://stackoverflow.com/questions/6491133
复制相似问题