Tarjei Huse wrote:

> Here's tha sql log. I finally started mysqld with the --log parameter and it
> worked. Anyhow, here it is. 
> 
> (here's some of the code, $year = 2001)
> $list_start = gmmktime(0,0,0,1,1,$year);
> $list_stop  = gmmktime (24,0,0,12,31,$year);
> 
> $article =  mgd_list_topic_calendar_all($main_t->up, $list_start, $list_stop,
> "date", "2");
> 
> returns "no article".
> 
> Mysql log:  (tell me if you need a longer log).
> 

This is the query in question, it has loads of stuff we don;t want to
know but...

>                       6 Query       SELECT article.id AS id,article.name AS
> name,title,abstract,content,author,Concat(firstname,If(firstname=''||lastname='','','
> '),lastname) AS authorname,article.topic AS
> topic,Date_format(article.created,'%d.%m.%Y') AS
> date,Date_format(article.created,'%D %b. %Y') AS
> adate,Date_format(article.created,'%D %M %Y') AS
> aldate,url,icon,extra1,extra2,extra3,article.score AS
> score,type,Unix_Timestamp(article.created) AS created,article.creator AS
> creator,Unix_Timestamp(revised) AS
> revised,revisor,revision,Unix_Timestamp(locked) AS
> locked,locker,Unix_Timestamp(approved) AS
> 
> 
>approved,approver,article.sitegroup,If(IsNull(calstart),'',If(caldays=0,Date_Format(calstart,'%d.%m.%Y'),Concat(Date_Format(calstart,If(Year(calstart)!=Year(From_Days(To_Days(calstart)+caldays)),'%d.%m.%Y',If(Month(calstart)!=Month(From_Days(To_Days(calstart)+caldays)),'%d.%m.','%d.'))),Date_Format(From_Days(To_Days(calstart)+caldays),'-%d.%m.%Y'))))
> AS calendar,If(IsNull(calstart),'',If(caldays=0,Date_Format(calstart,'%D %b.
> 
> 
>%Y'),Concat(Date_Format(calstart,If(Year(calstart)!=Year(From_Days(To_Days(calstart)+caldays)),'%D
> %b. %Y',If(Month(calstart)!=Month(From_Days(To_Days(calstart)+caldays)),'%D
> %b.','%D'))),Date_Format(From_Days(To_Days(calstart)+caldays),'-%D %b. %Y'))))
> AS acalendar,If(IsNull(calstart),'',If(caldays=0,Date_Format(calstart,'%D %M
> 
> 
>%Y'),Concat(Date_Format(calstart,If(Year(calstart)!=Year(From_Days(To_Days(calstart)+caldays)),'%D
> %M %Y',If(Month(calstart)!=Month(From_Days(To_Days(calstart)+caldays)),'%D
> %M','%D'))),Date_Format(From_Days(To_Days(calstart)+caldays),'-%D %M %Y')))) AS
> alcalendar,Unix_Timestamp(calstart) AS
> startdate,Unix_Timestamp(Date_Add(calstart, INTERVAL caldays DAY)) AS
> enddate,caldays,Date_Format(calstart,'%d.%m.%Y') AS
> calstart,Date_Format(From_Days(To_Days(calstart)+caldays),'%d.%m.%Y') As calstop
> FROM article,person

... here is where things start getting interesting.

> WHERE (article.type=2 AND article.topic IN
> 
> 
>(14,15,25,35,26,27,68,96,97,146,28,29,128,129,130,30,89,150,90,32,39,40,41,42,16,23,112,123,124,147,31,66,67,70,74,75,85,94,95,17,24,33,38,73,76,79,117,125,126,34,52,119,120,121,122,141,53,54,55,86,18,56,57,19,58,59,60,20,69,98,99,100,101,102,103,104,148,21,61,62,140,63,64,87,22,36,65,88,37,43)
> AND author=person.id AND article.up=0 AND Unix_Timestamp(calstart)>=978307200
> AND 24*60*60-1+Unix_timestamp(     Date_Add(calstart, INTERVAL caldays
> DAY))<=1009843200) AND (article.sitegroup in (0,1) AND person.sitegroup in (0,
> 1)) ORDER BY article.created DESC

If you do 

SELECT article.id FROM article,person WHERE <see above>

It should return no matches. Could you play a bit with the WHERE
clause to see what is actually causing that? And how many rows does

SELECT article.id FROM article WHERE article.type=2

return?

Emile



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to