Thread: mktime

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Olympia
    Posts
    19
    Rep Power
    0
    can someone please tell me how to make dates appear in a different format than numbers. Here is the code i am using to convert numbers and dates.

    $date = mktime($month,$day,$year); this works when inserting into a database

    but when i try calling from a database, this only displays todays date:
    $tourdate=date("l, F jS",mysql_result($result,$i,"date"));

    help is greatly appreciated.. also how could I make it so dates that have passed are not not called from the database? Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Niteroi, RJ, Brazil
    Posts
    30
    Rep Power
    15
    Is it a DATE field or VARHCAR/CHAR/INTEGER?

    I think you should one of these and not a date that could not be what you want!

    About the SQL statement:

    SELECT * FROM my_table WHERE date > $date
    or
    $now = now(); // is it now()? Check this please!
    SELECT * FROM my_table WHERE date > $now


    Got it?

    This will only list the events after a date x or after today/now. Let's see if works!

    ------------------
    Eduardo Teixeira Cardoso
    PHP Programmer from Brazil
    idnotfound@vircio.com.br

Similar Threads

  1. UNIX mktime to mySQL date or date
    By mediaworks in forum PHP Development
    Replies: 5
    Last Post: June 24th, 2003, 02:55 AM
  2. mktime problem
    By agblee1970 in forum PHP Development
    Replies: 2
    Last Post: February 10th, 2003, 12:01 PM
  3. problem with mktime function
    By agblee1970 in forum PHP Development
    Replies: 5
    Last Post: September 20th, 2002, 05:39 AM
  4. Is mktime() buggy?
    By RickEllis in forum PHP Development
    Replies: 4
    Last Post: November 2nd, 2001, 05:25 PM
  5. mktime funny dates in october?
    By pezzer in forum PHP Development
    Replies: 3
    Last Post: July 31st, 2001, 10:19 AM

IMN logo majestic logo threadwatch logo seochat tools logo