0
$mysql = mysql_query("SELECT pass, user, id, folder, http, spacelimit, language, theme, permbrowse, permupload, permcreate, permuser, permadmin, permdelete, permmove, permchmod, permget, permdeleteuser, permedituser, permmakeuser, permpass, permrename, permedit, permsub, formatperm, status, recycle, permprefs FROM ".$GLOBALS['config']['db']['pref']."users WHERE user='".mysql_real_escape_string($user)."'");
    list ($dbpass, $dbuser, $userid, $userdir, $http, $limit, $language, $theme, $permbrowse, $permupload, $permcreate, $permuser, $permadmin, $permdelete, $permmove, $permchmod, $permget, $permdeleteuser, $permedituser, $permmakeuser, $permpass, $permrename, $permedit, $permsub, $formatperm, $status, $recycle, $permprefs) = mysql_fetch_row($mysql);

错误在第 3 行。它说

警告:mysql_fetch_row() 期望参数 1 是资源,布尔值在第 83 行的 C:\xampp\htdocs\index.php 中给出

我尝试查找它,但无法找到修复程序。

我知道有些方法已被弃用,但我只是想解决这个问题,这样我就可以完成 2 项工作(目前)。任何帮助,将不胜感激。

4

2 回答 2

2

你在跑mysql_query(mysql_query(...))

$mysql = "SELECT pass, user, id, folder, http, spacelimit, language, theme, permbrowse, permupload, permcreate, permuser, permadmin, permdelete, permmove, permchmod, permget, permdeleteuser, permedituser, permmakeuser, permpass, permrename, permedit, permsub, formatperm, status, recycle, permprefs FROM ".$GLOBALS['config']['db']['pref']."users WHERE user='".mysql_real_escape_string($user)."'"; 

echo $mysql; // Get the output here and run it directly to see if it succeeds

$result = mysql_query($mysql) or die(mysql_error()); // add `or die(mysql_error())` to output an error if the query fails
于 2012-08-10T19:57:17.600 回答
0

阅读mysql_query 的文档!如果查询因任何原因失败,它将返回 FALSE。您可以使用mysql_error找出原因。

于 2012-08-10T19:57:07.753 回答