Hello. I put the whole point of the question in the title. I have updated the viewer every time I update the news page. I give the code:

$count = $news->views; $count++; $data = array('views' => $count, 'date' => $news->date); ORM::factory('News', $news->id) ->values($data) ->save(); 

When updating the views field, I initially only changed this field, and the field with the date also changed. Then I decided to try to replace the date with the one that was originally in this field, but it still does not work.

  • timestamp is a shtamp. The seal. Imprint. This is a time stamp. If you need to change - use data time datatime - DNS
  • @DNS Okay, thanks ... - Dmitriy

1 answer 1

 ALTER TABLE `news` MODIFY COLUMN `date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP;