Jump to content

Archived

This topic is now archived and is closed to further replies.

onthespot

help with new members

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Assuming that you are actually storing the data in a MySQL table ... SELECT * from members_table ORDER by id DESC LIMIT 5

That sort of sql query will give you the five (limit) records with the 5 highest ids, ordered from highest to lowest.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
  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_ECHO

any ideas?

Share this post


Link to post
Share on other sites
You only need to echo once:

echo "<td>" . $row['FirstName'] . "</td>";
echo "<td>" . $row['LastName'] . "</td>";

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.