$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为resource,boolean 在第83行的C:\ xampp \ htdocs \ index.php中给出
我试着查找它,但我找不到修复方法。
我知道有些方法已被弃用,但我只是想解决这个问题,所以我可以让它工作2(现在)。任何帮助将不胜感激。
答案 0 :(得分: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
答案 1 :(得分:0)
阅读documentation for mysql_query!如果查询因任何原因失败,它将返回FALSE。您可以使用mysql_error找出原因。