Jump to content


Photo

help with new members


  • Please log in to reply
10 replies to this topic

#1 onthespot

onthespot
  • Members
  • PipPipPip
  • Advanced Member
  • 424 posts

Posted 17 August 2006 - 09:03 PM

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?

#2 makeshift_theory

makeshift_theory
  • Members
  • PipPipPip
  • Advanced Member
  • 226 posts

Posted 17 August 2006 - 09:13 PM

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.
<b>Emacs</b> it's great for the body.
<br><br>
<b>Trust the TechnoLust</b>

<b><u>Have a question check here:</u></b>
PHP Manual: http://www.php.net

#3 onthespot

onthespot
  • Members
  • PipPipPip
  • Advanced Member
  • 424 posts

Posted 17 August 2006 - 09:14 PM

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?

#4 appeland

appeland
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 17 August 2006 - 09:17 PM

To help you we need to know what product you are using to realize your site.


#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 17 August 2006 - 09:18 PM

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.
Legend has it that reading the manual never killed anyone.
My site

#6 onthespot

onthespot
  • Members
  • PipPipPip
  • Advanced Member
  • 424 posts

Posted 17 August 2006 - 09:36 PM

thankyou andy, so if i change limit to 20, i will get last 20??

#7 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 17 August 2006 - 09:38 PM

this is true


#8 onthespot

onthespot
  • Members
  • PipPipPip
  • Advanced Member
  • 424 posts

Posted 17 August 2006 - 09:45 PM

ty all

#9 onthespot

onthespot
  • Members
  • PipPipPip
  • Advanced Member
  • 424 posts

Posted 19 August 2006 - 08:16 PM

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?

#10 onthespot

onthespot
  • Members
  • PipPipPip
  • Advanced Member
  • 424 posts

Posted 19 August 2006 - 08:50 PM

  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?

#11 Jeremysr

Jeremysr
  • Members
  • PipPipPip
  • Advanced Member
  • 199 posts
  • LocationSaskatchewan, Canada

Posted 19 August 2006 - 08:51 PM

You only need to echo once:

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users