Results 1 to 9 of 9

Thread: PhpMyAdmin help

  1. #1
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default PhpMyAdmin help



    Ive got a table and i need date and time for it, ive set the type to date but when i use
    mysql_query("INSERT INTO datetime (date, time) VALUES('" . $date . "', '" . $time . "' )")

    It puts the date as 0000-00-00 and the time as 00:00:00 instead of what i set it to.

    ps. the $date var is $date = date("d/m/y")
    Lets set the stage on fire, and hollywood will be jealous.

  2. #2
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Dont use table field types if you don't understand what they mean - use text/var chars/ints
    Hi, names James. I am a web developer.

  3. #3
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Protege View Post
    Dont use table field types if you don't understand what they mean - use text/var chars/ints
    I would use the default one, but i can't use "order" then because it will order them like this;

    02-03-08
    04-08-09
    09-01-00
    12-04-08
    13-12-01

    It treats the "-" like decimal points.
    Lets set the stage on fire, and hollywood will be jealous.

  4. #4
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    have the fields as varchar? U mayswell...

  5. #5
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Jackboy View Post
    have the fields as varchar? U mayswell...
    Read post #3. Its for a PM list so they need to be ordered by date, and having them as varchar won't work for that.
    Lets set the stage on fire, and hollywood will be jealous.

  6. #6
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    ohhhhhhhhhhhhhhhhhhhhhh

  7. #7
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Insure date is in the following format: YYYY-DD-MM and time is: HH:MM:SS and is a valid time/date.

  8. #8
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Quote Originally Posted by Tom743 View Post
    Read post #3. Its for a PM list so they need to be ordered by date, and having them as varchar won't work for that.
    Couldn't you order them by an id field or something?

  9. #9
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Tomm View Post
    Insure date is in the following format: YYYY-DD-MM and time is: HH:MM:SS and is a valid time/date.
    Thanks +rep.

    Quote Originally Posted by Trinity View Post
    Couldn't you order them by an id field or something?
    If i did that then i would have the same problem as using varchar?
    Lets set the stage on fire, and hollywood will be jealous.

Posting Permissions

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