power44 09:07:10 | 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 plus_signup")); <? 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"; ?> |
smo1234 09-07-2010 | 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 |
power44 09-08-2010 | Thanks smo1234 i used the order by command and it worked. |