#1
  1. No Profile Picture
    kumars
    Guest
    Devshed Newbie (0 - 499 posts)
    I have a date (LastDate) column in mySQL table. How can I make a search query in PHP to show all the rows where the date is lessthan today (ie: Or 'LastDate' has not expired)

    Thank you

    Kumars

    I
  2. #2
  3. No Profile Picture
    newmediaarts
    Guest
    Devshed Newbie (0 - 499 posts)
    IN PHP...

    $currentdate=(date("Y-m-d"));

    $selectfiles = "SELECT * FROM [tablenane] WHERE $lastdate < $currentdate;";

    MYSQL_QUERY($selectfiles);

    Basicly just compares dates in database with current date. Replace "*" with the fields you want or leave it to get all the fields.

    ------------------
    Luke Bowerman
    new media arts
    www.judebowerman.com/nma

Similar Threads

  1. mysql date time stamp and UTF8
    By doomish in forum MySQL Help
    Replies: 0
    Last Post: February 8th, 2004, 09:37 AM
  2. Select a mysql result date range with a drop down
    By horstuff in forum PHP Development
    Replies: 0
    Last Post: January 31st, 2004, 03:33 PM
  3. Getting a date from MYSQL using a query
    By Pyros in forum MySQL Help
    Replies: 1
    Last Post: January 10th, 2004, 02:09 PM
  4. asp mysql date inserting
    By eyelinkz in forum MySQL Help
    Replies: 2
    Last Post: January 9th, 2004, 12:17 AM
  5. inserting date to mysql db
    By bulletz in forum ASP Programming
    Replies: 3
    Last Post: December 22nd, 2003, 08:13 PM

IMN logo majestic logo threadwatch logo seochat tools logo