Jump to content


Photo

**SOLVED** SQL Issue - Query not working..


  • Please log in to reply
No replies to this topic

#1 Prismatic

Prismatic
  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego

Posted 25 March 2006 - 10:02 AM

On my forums i'm developing I have an Active Topic page. This page is supposed to list only the topics posted in within the last 30 minutes.

The query is as follows:

SELECT * FROM topics WHERE DATE_SUB(NOW(),INTERVAL '30:00' MINUTE_SECOND) >= time ORDER BY time DESC

Now, the "time" column is just a dump of time(); when the topic was posted. Im not sure but I think because the SQL is using now() and not time() it is failing (Failing as in outputting a bunch of topics that have not really been posted on within the last 30 minutes)

Any ideas?

EDIT - Figured it out, consider topic *SOLVED*




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users