14.07.2013, 09:19
Make a new table in the database called 'bussiness_visits' with the columns you need (id, name and time/hour). When a player uses the command, check that he really entered a bussiness and if so, make a insert to the table with his name and getdate() or gettime() to get when he entered.
After that, for the /lastentered command, make a simple select like "SELECT name, hour FROM bussiness_visits ORDER BY id DESC LIMIT 5" and send the message to the player.
After that, for the /lastentered command, make a simple select like "SELECT name, hour FROM bussiness_visits ORDER BY id DESC LIMIT 5" and send the message to the player.