MySQL query to fetch all user datas

Gajeel

Well-Known Member
Oct 4, 2011
2,411
413
Hello.

I am trying to make a user list for the come back of HabPRO. The user list will contain all user datas (username, motto, last online, and look), and their avatar will appear on the left side (like how a staff page is).

However, I am troubled on what syntax I should use in fetching them, and or if they are right (and in echoing the styling, the content boxes, the online/offline red/green color etc.).

So here is the page without the actual userlist:
h0x9z.png


Immediate help would be great.
 

iHarrison

Member
Mar 11, 2012
321
131
I maybe wrong, but try something like this:

Code:
$result = mysql_query("SELECT * FROM users");
 
while($row = mysql_fetch_assoc($result)) {
   echo $row['username'];
   echo $row['motto'];
   echo $row['last_online'];
   echo $row['figure'];
}

That maybe wrong tho and you'll need to do some editing for it to show the figure and last_online correctly. But it should be something to start with.
 

Gajeel

Well-Known Member
Oct 4, 2011
2,411
413
Thanks for the help. I'd go and refer styling on how the staff page echoes the style. TY so much. But if I get in trouble can I pm you? :)
 

Muffins

Member
May 12, 2012
18
0
I know that but then it would only show the amount in the limit. Wait I think I have an idea. I can use num_rows and divide that number by 10 and then make the amount of links counting from 1 to (result of the num_rows divided by 10 and rounded) and make the links use a $_GET request to get page 2 etc...
 

Users who are viewing this thread

Top