Click to See Complete Forum and Search --> : Retrieve record from database that matches criteria


sae
06-12-2006, 06:16 PM
Hello People!

I have a website (http://www.canadianyouthworker.com) that runs off of a mysql database. What I want to do is display the username of the most recently registered member.

The database has mutliple "tables" with the data for the users stored in a table called "nuke_users". This table has multiple "headings" they are:

pn_uid, pn_name, pn_uname, ....

What I want to do is display the newest pn_uname entry. pn_uid is increased by 1 everytime someone registers. So how do you can find the entry with the biggest number under the pn_uid column and then display the corresponding data located under the pn_uname column?

Thanks!

NogDog
06-12-2006, 06:23 PM
Somethint like this (not sure which columns you want, so add/delete column names as needed, being sure to leave in pn_uid since you want to sort on it):

SELECT pn_uname, pn_uid FROM nuke_users ORDER BY pn_uid DESC LIMIT 1