How do add date and time stamp to an INSERT via PHP with mySQL?

前端 未结 4 1745
感动是毒
感动是毒 2021-01-24 18:38

I have an insert script with mySQL. I need to place the date and time when the record is created in the \'add_time\" column.

Can anyone show me how to modify my existin

4条回答
  •  迷失自我
    2021-01-24 19:15

    Add 'time' column to your 'cartons_added' table.

    And use this as order

    $order = "INSERT INTO cartons_added (type, part_no, add_type, add_qty, 
      add_ref, add_by, add_notes, time)
    
      VALUES
      ('$_POST[type]', 
      '$_POST[part_no]', 
      '$_POST[add_type]', 
      '$_POST[add_qty]', 
      '$_POST[add_ref]', 
      '$_POST[add_by]', 
      '$_POST[add_notes]',
      '".time().")";
    

提交回复
热议问题