我正在测试这组代码,我收到错误:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\Program Files (x86)\Ampps\www\Connection Files\friends-list.php on line 16
我不确定是什么导致这组代码返回一个布尔值:
$cuser = $_COOKIE["cuser"];
$csalt = $_COOKIE["csalt"];
$queryuserstats = mysqli_query($connection, "SELECT * FROM s_users WHERE Salt='csalt'");
$userstats = mysqli_fetch_array($queryuserstats, MYSQLI_ASSOC);
$userfriendstable = ("$userstats[0]['Username']" . "Friends");
$findfriends = mysqli_query($connection, "SELECT * FROM $userfriendstable");
$userfriends = mysqli_fetch_array($findfriends, MYSQLI_ASSOC);
我怀疑我将变量userfriendstable
设置错误,但我并不完全确定。