SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: MySQL and dates

Hybrid View

  1. #1
    SitePoint Enthusiast jrwap's Avatar
    Join Date
    Oct 2000
    Location
    NJ
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL and dates

    Im trying to take events out of a MySQL database. I want them to be occuring on 'today' or any day after that. How can I do this?

    Here is what I am working with...
    PHP Code:
    $DB_site->query("SELECT eventid, subject, event, eventdate, public, userid, time, place
                       FROM calendar_events
                       WHERE eventdate LIKE '
    $year-$doublemonth-%' AND ((userid = '$bbuserinfo[userid]' AND public = 0) OR (public = 1))".$addsql); 
    What I have here pulls out all of the events that occur in 'this' month and 'this' year.

    Anyhelp would be greatly appreciated.

    Thanks,

    -JRW

  2. #2
    SitePoint Enthusiast jrwap's Avatar
    Join Date
    Oct 2000
    Location
    NJ
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Duh.. how stupid. I just needed to get rid of 'LIKE' and use '>'.

    Thanks anyway,

    -JRW


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •