vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| cron wrote: > Hi I need to find users who logged in to my site in the last 5 > minutes. This is code i found but it aint working. Anyone know why? > > Select * from user where lastlogin>= '' & DateAdd("n",-5, Now()) > > Thanks a lot! > Ciarán Since all you have told us is "it aint (SIC) working" and you haven't even bothered to tell us what you are actually seeing, it could be just about anything: There is no such table as user there is no such field as lastlogin you have an uneven number of quotes the & is not a valid symbol in whatever language you are working in the mysql server is not running you entered the string in Notepad instead of submitting it to mysql and many many more. Care to tell us a bit more about what you are seeing? |
| ||||
| > Since all you have told us is "it aint (SIC) working" and you haven't even > bothered to tell us what you are actually seeing, it could be just about > anything: No need to be rude! It was completely wrong: I figured it out: To find a user who's logged in in the last 5 minutes something like this works: SELECT * FROM user WHERE (NOW() - INTERVAL 5 MINUTE) <= lastlogin ORDER BY lastlogin; Cheers, Ciarán |