Date is inserting as 0000-00-00 00:00:00 in mysql

后端 未结 3 654
挽巷
挽巷 2021-01-13 14:57

My $date output is in the foreach loop

09/25/11, 02/13/11, 09/15/10, 06/11/10, 04/13/10, 04/13/10, 04/13/10, 09/24/09, 02/19/09, 12/21/

3条回答
  •  猫巷女王i
    2021-01-13 15:18

    You don't have the century in your date, try to convert it like this:

    format('Y-m-d');
    print $date;
    

    Prints:

    2011-09-25
    

    Now you can insert $date into MySQL.

提交回复
热议问题