Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] MySQL - trying to insert date only.

Expand Messages
  • Riviere Informatique SARL
    Use curdate() instead of now() Regards, Steven.
    Message 1 of 2 , Nov 1, 2004
      Use curdate() instead of now()

      Regards,
      Steven.

      zeshanism wrote:

      >my $sql = qq~ INSERT INTO $table(id, job, name, type, chars, trans,
      >tim) VALUES ('', "$job", "$name", "$type", "$chars", "$trans", now())
      >~;
      >
      >Only now() function is working for me in the script, this inserts
      >the time as well with date. I need Date only, so I found a way
      >around it to define 'tim' as SMALLINT(10) so it only gets YYYY-MM-
      >DD, dirty trick.
      >
      >But anyone can tell me what should I use to insert DATE only? what
      >should I replace now() with? as I want to define the column 'tim' as
      >DATE rather SMALLINT(10).
      >
      >Thanks for any help.
      >
      >Zeshan.
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.