Unknown column 'last_visit' in 'field list' #735

Closed
opened 2026-10-05 00:14:46 +02:00 by adam · 3 comments
Owner

I'm getting the above error on lots of pages (e.g. https://photos.samwilson.id.au/picture/6834 ), after upgrading to 2.9.2:

Warning: [mysql error 1054] Unknown column 'last_visit' in 'field list'

UPDATE user_infos
  SET last_visit = NOW(),
      lastmodified = lastmodified
  WHERE user_id = 1
 in /var/www/photos.samwilson.id.au/include/dblayer/functions_mysqli.inc.php on line 845

My set up is as follows:

  • Piwigo 2.9.2
  • Operating system: Linux
  • PHP: 7.0.22-0ubuntu0.16.04.1 (Show info) [2017-12-05 10:21:51]
  • MySQL: 5.7.20-0ubuntu0.16.04.1 [2017-12-04 21:21:51]
  • Graphics Library: External ImageMagick 6.8.9-9
  • Plugins: OpenStreetMap.
I'm getting the above error on lots of pages (e.g. https://photos.samwilson.id.au/picture/6834 ), after upgrading to 2.9.2: **Warning: [mysql error 1054] Unknown column 'last_visit' in 'field list'** ``` UPDATE user_infos SET last_visit = NOW(), lastmodified = lastmodified WHERE user_id = 1 in /var/www/photos.samwilson.id.au/include/dblayer/functions_mysqli.inc.php on line 845 ``` My set up is as follows: - Piwigo 2.9.2 - Operating system: Linux - PHP: 7.0.22-0ubuntu0.16.04.1 (Show info) [2017-12-05 10:21:51] - MySQL: 5.7.20-0ubuntu0.16.04.1 [2017-12-04 21:21:51] - Graphics Library: External ImageMagick 6.8.9-9 - Plugins: OpenStreetMap. <!-- github-sync-id:279222890 -->
adam closed this issue 2026-10-05 00:14:46 +02:00
Author
Owner
I've just found http://piwigo.org/forum/viewtopic.php?id=27923 <!-- github-comment-id:349175425 -->
Author
Owner

Running the following updates fixed this:

ALTER TABLE `comments` CHANGE `date` `date` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `history` CHANGE `date` `date` date NOT NULL default '1970-01-01';
ALTER TABLE `images` CHANGE `date_available` `date_available` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `old_permalinks` CHANGE  `date_deleted` `date_deleted` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `rate` CHANGE `date` `date` date NOT NULL default '1970-01-01';
ALTER TABLE `sessions` CHANGE `expiration` `expiration` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `upgrade` CHANGE `applied` `applied` datetime NOT NULL default '1970-01-01 00:00:00';
ALTER TABLE `user_infos` CHANGE `registration_date` `registration_date` datetime NOT NULL default '1970-01-01 00:00:00';

ALTER TABLE `user_infos`
  ADD COLUMN `last_visit` datetime default NULL,
  ADD COLUMN `last_visit_from_history` enum('true','false') NOT NULL default 'false'
;
Running the following updates fixed this: ```sql ALTER TABLE `comments` CHANGE `date` `date` datetime NOT NULL default '1970-01-01 00:00:00'; ALTER TABLE `history` CHANGE `date` `date` date NOT NULL default '1970-01-01'; ALTER TABLE `images` CHANGE `date_available` `date_available` datetime NOT NULL default '1970-01-01 00:00:00'; ALTER TABLE `old_permalinks` CHANGE `date_deleted` `date_deleted` datetime NOT NULL default '1970-01-01 00:00:00'; ALTER TABLE `rate` CHANGE `date` `date` date NOT NULL default '1970-01-01'; ALTER TABLE `sessions` CHANGE `expiration` `expiration` datetime NOT NULL default '1970-01-01 00:00:00'; ALTER TABLE `upgrade` CHANGE `applied` `applied` datetime NOT NULL default '1970-01-01 00:00:00'; ALTER TABLE `user_infos` CHANGE `registration_date` `registration_date` datetime NOT NULL default '1970-01-01 00:00:00'; ALTER TABLE `user_infos` ADD COLUMN `last_visit` datetime default NULL, ADD COLUMN `last_visit_from_history` enum('true','false') NOT NULL default 'false' ; ``` <!-- github-comment-id:349527562 -->
Author
Owner

That solved my problem too : )
Thanks !

That solved my problem too : ) Thanks ! <!-- github-comment-id:462328677 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#735