Cetanu Posted June 23, 2009 Share Posted June 23, 2009 I was told that there was a way to make a memberlist by including the members table from my database. Is that true? Or do I need to make a table that I physically need to update whenever someone joins? If I include the database table, how would I hide users' passwords? Quote Link to comment https://forums.phpfreaks.com/topic/163406-memberlist/ Share on other sites More sharing options...
Maq Posted June 23, 2009 Share Posted June 23, 2009 I was told that there was a way to make a memberlist by including the members table from my database. Is that true? Or do I need to make a table that I physically need to update whenever someone joins? You should already be storing users in a table. If I include the database table, how would I hide users' passwords? Don't include it in your query. You just have to query the tables and fields that you want to display in the memberlist feature. Quote Link to comment https://forums.phpfreaks.com/topic/163406-memberlist/#findComment-862153 Share on other sites More sharing options...
Cetanu Posted June 23, 2009 Author Share Posted June 23, 2009 Well I am storing them in a table on the database, but I wanted to show that table on a regular page as a memberlist (without the passwords). Quote Link to comment https://forums.phpfreaks.com/topic/163406-memberlist/#findComment-862212 Share on other sites More sharing options...
Maq Posted June 23, 2009 Share Posted June 23, 2009 Well I am storing them in a table on the database, but I wanted to show that table on a regular page as a memberlist (without the passwords). You need to create a select statement from the table(s) that your member information is on and iterate through the results. Google, "mysql php select". Quote Link to comment https://forums.phpfreaks.com/topic/163406-memberlist/#findComment-862218 Share on other sites More sharing options...
adamlacombe Posted June 23, 2009 Share Posted June 23, 2009 Just do something like this: <? print "<title>Members</title>"; print "<link rel='stylesheet' href='style.css' type='text/css'>"; print "<div class='divider'><table class='divider'> <strong>Members</strong>"; print "<tr class='headline'><td width=60%>Name</td><td>Other</td></tr>"; $members="SELECT * from users"; $members2=mysql_query($members) or die("Could not get members"); while($members3=mysql_fetch_array($members2)) { $members3[username]=strip_tags($members3[username]); print "<tr class='mainrow'><td><a href='index.php?case=profile&username=$members3[username]'>$members3[username]</a><br />"; if($members3[avatar]){ print "<img src='$members3[avatar]' height='110' width='110' /><br />"; } print "</td>"; print "<td>Other stuff could go here</td>"; } print "</tr></table></div>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/163406-memberlist/#findComment-862284 Share on other sites More sharing options...
Cetanu Posted June 24, 2009 Author Share Posted June 24, 2009 Thanks, guys! Quote Link to comment https://forums.phpfreaks.com/topic/163406-memberlist/#findComment-862353 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.