[geeklog-devel] Geeklog and MySQL 3.22

Dirk Haun dirk at haun-online.de
Wed Feb 12 13:58:03 EST 2003

Apparantly, many hosting services are still running MySQL 3.22.something
:-/ Among them is, for example, Germany's second biggest hoster (1.5
million .de domains).

So it may be worthwhile to investigate what's keeping Geeklog from
working on MySQL 3.22. One of the users of geeklog.info already spent
some time with this and found a simple solution for the problem with the
What's New block.

All you need to do is change the syntax for subtraction of times from '-'
to 'date_sub', e.g.

$sql = "SELECT count(*) AS count FROM {$_TABLES['stories']} WHERE (date
>= (NOW() - INTERVAL {$_CONF['newstoriesinterval']} SECOND)) AND (date <=
NOW()) AND (draft_flag = 0) AND (" . $nesql . ")"; 


$sql = "SELECT count(*) AS count FROM {$_TABLES['stories']} WHERE (date
>= (date_sub(NOW(), INTERVAL {$_CONF['newstoriesinterval']} SECOND))) AND
(date <= NOW()) AND (draft_flag = 0) AND (" . $nesql . ")"; 

(and a similar change in another place).

Question for the (My)SQL gurus: Do you see any problems with this.
Performance-wise, compatibility, etc?

The other issue people will run into is actually at install time when
they get errors like "1121: Column 'date' is used with UNIQUE or INDEX
but is not defined as NOT NULL". The install docs mention this problem,
but the solution there (removing two line from mysql_tableanddata.php) is
out of date since we introduced additional index fields in 1.3.7.

Not sure what we could do there other than providing a second version of
mysql_tableanddata.php without the additional index fields ...

bye, Dirk


More information about the geeklog-devel mailing list