Announcement

  •  » Requests
  •  » Change query syntax for display a calendar by post date

#1 2015-02-12 00:12:26

msakik
Translation Team
São Paulo, Brazil
2013-09-06
78

Change query syntax for display a calendar by post date

Hi,
Inspecting queries I found
SELECT DISTINCT(MONTH(date_creation)) as period,
  COUNT(DISTINCT id) as nb_images FROM images
INNER JOIN image_category ON id = image_id
    WHERE 1 = 1 AND date_creation BETWEEN '1975-01-01' AND '1975-12-31 23:59:59'
  GROUP BY period;
(this query time : 0.001 s)
(total SQL time  : 0.003 s)
(total time      : 0.019 s)
(num rows        : 0 )

but as I have images like date_creation=1975-00-00 00:00:00
I want to suggest change the query to something like
.....
WHERE date_creation LIKE  '1975%'
.....
that returns my missing image when using phpmyadmin.

If someone point me where is it in the source code I can do some tests and propose a patch for this.

Masaki

Piwigo version: 2.7.3
PHP: 5.5.9-1ubuntu4.5
MySQL: 5.5.40-0ubuntu0.14.04.1

Offline

 

#2 2015-02-12 08:01:14

nicolas
Former Piwigo Team
2004-12-30
1232

Re: Change query syntax for display a calendar by post date

msakik wrote:

but as I have images like date_creation=1975-00-00 00:00:00
I want to suggest change the query to something like

Of course it can be done but your date is incorrect

Offline

 
  •  » Requests
  •  » Change query syntax for display a calendar by post date

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact