Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » Customizing the SQL statement
Re: Customizing the SQL statement [message #860 is a reply to message #859] Tue, 29 May 2007 08:20 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2361
Registered: April 2006
Location: Surrey, UK
Senior Member
I have discovered what the problem is - MySQL does not allow a "GROUP BY ... WITH ROLLUP" to be used with "ORDER BY ...". The solution is to edit the getdata() method inside the 'dml.mysql.class.inc' file in order to change
    if (!empty($this->sql_groupby)) {
        $group_str = "GROUP BY $this->sql_groupby";
    } else {
        $group_str = NULL;
    } // if

to the following:
    if (!empty($this->sql_groupby)) {
        $group_str = "GROUP BY $this->sql_groupby";
        if (eregi(" WITH ROLLUP", $this->sql_groupby)) {
            $this->sql_orderby = null;
        } // if
    } else {
        $group_str = NULL;
    } // if

This will cause the ORDER BY clause to be ommitted if the GROUP BY clause contains "WITH ROLLUP".

This change has been tested with version 1.24.0 and will be included in version 1.25.0


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using dropdown
Next Topic: mnu_task.pattern_id='SEARCH'
Goto Forum:
  


Current Time: Sat Aug 24 12:14:08 EDT 2024

Total time taken to generate the page: 0.00927 seconds