I have been working on the following function which creates an array and adds two integers to it based off of the last two rows in a database.
function featuredUsers(){
$users = array();
$query = mysql_query("SELECT * FROM `featured_users` ORDER BY unique DESC LIMIT 2");
while ($row = mysql_fetch_assoc($query)) {
array_push($users, $row["uid"]);
}
return $users;
}
"Unique" uniquely identifies each row, and "uid" contains the user ids that we are trying to add to the array. However, the array remains empty, and the console returns no errors besides "mysql_fetch_assoc() expects parameter 1 to be resource, boolean...". No other functions in our code use a resource as the first parameter.
Is there a simple error I'm overlooking?