how to make a userlist with php

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jun 7, 2010
Messages
85
Reaction score
27
Hello people,

Here a tut how to make a user list with php.
First whe just start with
PHP:
<?php

?>
really simple.
now whe make a query
PHP:
<?php
$userlist_query = mysql_query("SELECT * FROM users");
?>
yup really simple
now whe get the data as a object and whe order the users by id
PHP:
<?php
$userlist_query = mysql_query("SELECT * FROM users ORDER BY id DESC");
$get_users = mysql_fetch_object($userlist_query);
?>
so the query is done and now whe al get the data by a while like this
PHP:
<?php
$userlist_query = mysql_query("SELECT * FROM users ORDER BY id DESC");
while($get_users = mysql_fetch_object($userlist_query)) {
echo $get_users->username;
echo '<br />';
}
?>
that is al :)
dont forget to include your config.php
it can i make a mistake i dont tested it ;x
it can i make a bad english text i am hollands

greats ,
Smiegles
 
Status
Not open for further replies.
Back