PDA

View Full Version : Little SQL Query Help


Mr Chad
12-10-2005, 05:08 AM
How would i pull the new user? like i can get the total members by doing this:

// get forum members
$querya="SELECT COUNT(*) AS users, MAX(userid) AS max FROM " . $TABLE_PREFIX . "user WHERE usergroupid!=4";
$numa = mysql_query_eval($querya,$link);
$numb = mysql_fetch_array($numa);
$numbermembers=number_format($numb['users']);
mysql_free_result($numa);

what about the new user

merk
12-10-2005, 05:43 AM
SELECT user.* FROM user ORDER BY userid DESC LIMIT 1

Mr Chad
12-10-2005, 06:44 AM
SELECT user.* FROM user ORDER BY userid DESC LIMIT 1

thanks