Professional Web Applications Themes

date for mysql - PHP Development

how can I format the current date and time so that I can insert it into a mysql table with an insert query?...

  1. #1

    Default date for mysql

    how can I format the current date and time so that I can insert it into a
    mysql table with an insert query?
    Diana Guest

  2. #2

    Default Re: date for mysql

    insert into table (date_created) values( now() )

    ;-)
    pete

    Diana Castillo wrote:
     
    Pete Guest

  3. #3

    Default Re: [PHP] date for mysql

    On Fri, Oct 17, 2003 at 03:28:50PM +0200, Diana Castillo wrote:
    :
    : how can I format the current date and time so that I can insert it into a
    : mysql table with an insert query?

    That depends on the column type of your MySQL table. Is it a DATETIME?
    DATE? TIMESTAMP? TIME? Or just a YEAR?

    http://www.mysql.com/doc/en/Date_and_time_types.html

    Once you know the column type and its format, you can use PHP's date()
    function to do the correcting formatting for MySQL.
    Eugene Guest

Similar Threads

  1. mySQL Update Date
    By woribhabor in forum Coldfusion Database Access
    Replies: 2
    Last Post: January 16th, 04:40 AM
  2. MySQL Date issue
    By petron2002 in forum Coldfusion Database Access
    Replies: 4
    Last Post: October 2nd, 11:43 PM
  3. php-mysql date problem
    By Dominique Javet in forum PHP Development
    Replies: 1
    Last Post: May 4th, 11:31 PM
  4. PHP Date into MySQL
    By Sue Roussie in forum PHP Development
    Replies: 1
    Last Post: February 13th, 10:11 PM
  5. date mysql
    By --==Pyrix==-- in forum PHP Development
    Replies: 1
    Last Post: September 7th, 11:09 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139