Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Members Page (SELECT) Error! Re: Members Page (SELECT) Error!

#95634
Thoven78
Member

The reason why you’re getting “The users are: Resource id #3” is because whenever you do a query you always have to fetch the table. This is what the code should have looked like.



< ?php
$connect = mysql_connect("host", "username", "password");
$select_db = mysql_select_db("database", $connect);
if(!$select_db){
die(mysql_error());
}

$write = mysql_query("SELECT username FROM husers");
$users = "";
while ($row = mysql_fetch_assoc($write)) {
$users = $row;
}
?>