onthespot Posted August 17, 2006 Share Posted August 17, 2006 could anyone help me! i need to display the latest members that have joined my site! what is the best way to go around doing this? Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/ Share on other sites More sharing options...
makeshift_theory Posted August 17, 2006 Share Posted August 17, 2006 Well assuming your storing them a mysql database...When you do your search query to your mysql database just do ASC and that should give you the newest entry. Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-76458 Share on other sites More sharing options...
onthespot Posted August 17, 2006 Author Share Posted August 17, 2006 could you provide code for this mate?? my members are stored in database with their id's! surely the newest idea would be the latest member? Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-76462 Share on other sites More sharing options...
appeland Posted August 17, 2006 Share Posted August 17, 2006 To help you we need to know what product you are using to realize your site. Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-76467 Share on other sites More sharing options...
AndyB Posted August 17, 2006 Share Posted August 17, 2006 Assuming that you are actually storing the data in a MySQL table ... SELECT * from members_table ORDER by id DESC LIMIT 5That sort of sql query will give you the five (limit) records with the 5 highest ids, ordered from highest to lowest. Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-76468 Share on other sites More sharing options...
onthespot Posted August 17, 2006 Author Share Posted August 17, 2006 thankyou andy, so if i change limit to 20, i will get last 20?? Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-76476 Share on other sites More sharing options...
BillyBoB Posted August 17, 2006 Share Posted August 17, 2006 this is true Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-76477 Share on other sites More sharing options...
onthespot Posted August 17, 2006 Author Share Posted August 17, 2006 ty all Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-76481 Share on other sites More sharing options...
onthespot Posted August 19, 2006 Author Share Posted August 19, 2006 ok im unsure of how to execute this! ive got to this part now, and dont understand it!i have a line in my html script where i want to insert "SELECT * from users ORDER by id DESC LIMIT 5"could you tell me exactly how to put this in? Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-77329 Share on other sites More sharing options...
onthespot Posted August 19, 2006 Author Share Posted August 19, 2006 echo "<td>" . echo $row['FirstName'] . "</td>"; echo "<td>" . echo $row['LastName'] . "</td>";with those two lines im getting this error:Parse error: parse error, unexpected T_ECHOany ideas? Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-77339 Share on other sites More sharing options...
Jeremysr Posted August 19, 2006 Share Posted August 19, 2006 You only need to echo once:echo "<td>" . $row['FirstName'] . "</td>";echo "<td>" . $row['LastName'] . "</td>"; Quote Link to comment https://forums.phpfreaks.com/topic/17887-help-with-new-members/#findComment-77340 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.