gpt4 book ai didi

php - 在 PHP 中使用 mysql_fetch_assoc 时的警告

转载 作者:行者123 更新时间:2023-11-29 03:52:03 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result

当我运行我的 php 页面时,出现此错误并且不知道出了什么问题,有人可以帮忙吗?如果有人需要更多信息,我会发布整个代码。

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource inH:\Program Files\EasyPHP 2.0b1\www\test\info.php on line 16
<?PHP

$user_name = "root";
$password = "";
$database = "addressbook";
$server = "127.0.0.1";

$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);

if ($db_found) {

$SQL = "SELECT * FROM tb_address_book";
$result = mysql_query($SQL);

while ($db_field = mysql_fetch_assoc($result)) {
print $db_field['ID'] . "<BR>";
print $db_field['First_Name'] . "<BR>";
print $db_field['Surname'] . "<BR>";
print $db_field['Address'] . "<BR>";
}

mysql_close($db_handle);

}
else {
print "Database NOT Found ";
mysql_close($db_handle);
}

?>

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