cameeob2003 Posted July 1, 2006 Share Posted July 1, 2006 I want to display all the users in my database with the value of members greater than the default of 0. I already have the following code:[code]<?php$member = $_SESSION['member']if($member > 0){}?>[/code]I just cant figure out how to get it to display only the users with a greater value than 0. I am kinda new to the entire php thing but learning so any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/13391-displaying-users-with-only-members-0/ Share on other sites More sharing options...
shocker-z Posted July 1, 2006 Share Posted July 1, 2006 Where are you storing all your data as at the moment your settings $member as $_SESSION['member'] but where is $_SESSION['member'] defined?RegardsLiam Link to comment https://forums.phpfreaks.com/topic/13391-displaying-users-with-only-members-0/#findComment-51712 Share on other sites More sharing options...
cameeob2003 Posted July 1, 2006 Author Share Posted July 1, 2006 I have my $_SESSION['member'] defined in my login script prior to me using that code. I did this to basicaly pre-load the users entire settings. If this doesnt work then how would I define this before calling for it. Link to comment https://forums.phpfreaks.com/topic/13391-displaying-users-with-only-members-0/#findComment-51714 Share on other sites More sharing options...
.josh Posted July 1, 2006 Share Posted July 1, 2006 [code]<?php$sql = "select * from tablename where members > 0";$result = mysql_query($sql);while($list = mysql_fetch_array($result)) { //example column names. use your own echo $list['membername'] . " " . $list['members'] . "<br>";}?>[/code] Link to comment https://forums.phpfreaks.com/topic/13391-displaying-users-with-only-members-0/#findComment-51721 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.