1 (edited by beipink 2007-01-18 03:27)

Topic: Query Issue with AP_News_Generator.php and SQLite

the follow query does not work with SQLite or at least I could not get it to work!

$result = $db->query('SELECT id, subject FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' AND 
posted>=UNIX_TIMESTAMP(\''.$year_start.'-'.$month_start.'-01\') AND posted<UNIX_TIMESTAMP
(\''.$year_end.'-'.$month_end.'-01\') ORDER BY posted DESC') or error('Unable to fetch topic list', __FILE__, 
__LINE__, $db->error());

Is there anybody who got a solution to the issue?
thanks a lot
Kirk

Re: Query Issue with AP_News_Generator.php and SQLite

Replace the call to UNIX_TIMESTAMP() to a call to PHP's mktime function (the first 3 arguments should be 0 for obvious reasons)

Re: Query Issue with AP_News_Generator.php and SQLite

I did replace UNIX_TIMESTAMP() with PHP's time() and even with Timestamp taken from the db! I don't think the problem is the timestamp!!
thanks
Kirk

Re: Query Issue with AP_News_Generator.php and SQLite

UNIX_TIMESTAMP is the issue
Here's a fix though:
http://punbb.org/forums/viewtopic.php?pid=35109#p35109