Welcome Guest, Not a member yet? Register   Sign In
Possible bug on count_all_results with distinct clause???
#4

[eluser]jmadsen[/eluser]
from the mysql_driver.php (and all other drivers, I believe):

Code:
/**
     * The syntax to count rows is slightly different across different
     * database engines, so this string appears in each driver and is
     * used for the count_all() and count_all_results() functions.
     */
    var $_count_string = 'SELECT COUNT(*) AS ';

So, using count_all_results() this way will not work - you cannot create a COUNT(DISTINCT col) with it.

Workaround is obviously to use the ->select() method, and the Guide should prolly be updated


Messages In This Thread
Possible bug on count_all_results with distinct clause??? - by El Forum - 08-11-2011, 09:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB