problem with Select LAST COMMAND

i want to display the last figure userid from my database and here is the query i used but it doesn't display anything
$row8 = mysql_fetch_object(mysql_query("SELECT FIRST(userid) AS last FROM


<? echo"$row8->last"; ?>

What can be wrong with the code as it seems the COUNT query code below worked

$row7 = mysql_fetch_object(mysql_query("SELECT COUNT(userid) AS total FROM

plus_login where status='on'"));

<? echo"$row7->total"; ?>
I don't think ther is any command as SELECT FIRST. If you have any autoincrement field then you can display using ORDER BY that field. Or if you have date and time of signup then you can use the ORDER BY to display the last record.

In your count ( 2nd query ) I don't see any problem. Try by removing the where clause
Thanks smo1234 i used the order by command and it worked.
Please Login to post your reply or start a new topic