[eluser]girv[/eluser]
I've been upgrading my (fairly simple) site from CI 1.5.4 to 1.6.0. Its PHP 4.3.11 + MySQL 3.23(.58?). Yes, I know I need to upgrade both of those.
(1) MySQL < 4.1 doesn't support character sets, so I've hacked db_set_charset in mysql_driver.php (line 95) to always return true. So far it doesn't look like there are any problems, but my site is very simple so caveat emptor!
(2) I have Active Record code that now does:
Code:
$this->db->order_by('id','random');
But the SQL it generates gives me the error:
Code:
Error Number: 1064
You have an error in your SQL syntax near 'RAND() LIMIT 1' at line 4
SELECT `id`, `text`, `grpid` FROM (`gn_tagline`) WHERE `grpid` = 1 ORDER BY `` RAND() LIMIT 1
The problem is the two backticks `` after ORDER BY.
I hacked in a fix into CI_DB_active_recorder.order_by():
Change line 765 to:
I guess there is a better fix in _protect_identifiers!
These are quick hacks I know, but they will hold me until 1.6.1 comes out or
I can migrate to my new box with PHP 5 + Postgres. I post in the hope these
may help someone else in the same boat...