vince2doom
12-18-2008, 11:38 AM
Sql: Select all posts of 2008 and a specific month
Hi all,
I've got a question, I'm trying to make an archive. I'm using UNIX timestamps. This is my query:
PHP Code:
$sql->query('SELECT DISTINCT MONTHNAME(FROM_UNIXTIME(datum)) as `month`,テつ*
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*YEAR(FROM_UNIXTIME(datum)) as `year`,
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*MONTH(FROM_UNIXTIME(datum)) as `monthNum`
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*FROM `Nieuws`
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*WHERE `year` = '.$link->stuk(2).'
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*ORDER BY `year` ASC, `monthNum` ASC');
But I get the error:
Quote:
Unknown column 'year' in 'where clause'
I defined year, so why doesn't it work ?
Thanks in advance !
Hi all,
I've got a question, I'm trying to make an archive. I'm using UNIX timestamps. This is my query:
PHP Code:
$sql->query('SELECT DISTINCT MONTHNAME(FROM_UNIXTIME(datum)) as `month`,テつ*
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*YEAR(FROM_UNIXTIME(datum)) as `year`,
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*MONTH(FROM_UNIXTIME(datum)) as `monthNum`
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*FROM `Nieuws`
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*WHERE `year` = '.$link->stuk(2).'
テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*テつ*ORDER BY `year` ASC, `monthNum` ASC');
But I get the error:
Quote:
Unknown column 'year' in 'where clause'
I defined year, so why doesn't it work ?
Thanks in advance !
