Welcome Guest, Not a member yet? Register   Sign In
EzAuth 0.6 - The Easiest User Management System for CI
#33

[eluser]flogiston[/eluser]
Hi,

Had the same problem and looked a bit deeper. The problem lies in the mysql driver: it incorrectly adds backticks(`) arround the '*' so MySQL thinks '*' is the name of a field.

SELECT `ez_users`.`id` as id, `ez_users`.`*`, `ez_auth`.`activation_code` FROM ...
should be
SELECT `ez_users`.`id` as id, `ez_users`.*, `ez_auth`.`activation_code` FROM ...

I modified the file "system\database\drivers\mysql\mysql_driver.php", function _escape_identifiers (line 441) so it only escapes the table name, not the '*':
I basically changed line 441 from
Code:
$str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char;
to

Code:
if($this->_endsWith($item, '.*'))
{
   $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.', $item);            
} else
{
   $str = $this->_escape_char.str_replace('.', $this->_escape_char.'.'.$this->_escape_char, $item).$this->_escape_char;            
}
I also added the function _endsWith below the function _escape_identifiers:
Code:
function _endsWith($haystack, $needle){
   return strrpos($haystack, $needle) === strlen($haystack)-strlen($needle);
}

I know we shouldn't be modifying the core, but this seems to be a bug in the mysql_driver IMHO as it generates invalid sql.

HTH


[quote author="mdriscol" date="1230605086"]I tried the extend library class described in the linked post. I even edited the Session class directly and changed the affected lines but it still didn't fix it. I still get the same error when trying to log into ez_auth. How did you get it to work??[/quote]


Messages In This Thread
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 01-31-2008, 12:40 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-01-2008, 07:45 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-01-2008, 08:17 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-01-2008, 09:36 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-01-2008, 12:48 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-01-2008, 01:06 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-01-2008, 01:47 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-12-2008, 09:49 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-12-2008, 11:00 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-12-2008, 11:11 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-22-2008, 01:04 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-22-2008, 01:08 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-22-2008, 09:12 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 03-22-2008, 03:43 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 04-23-2008, 11:40 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 06-23-2008, 11:06 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 06-24-2008, 01:07 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 06-29-2008, 05:59 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 07-05-2008, 03:08 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 07-29-2008, 04:32 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 07-31-2008, 12:25 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 07-31-2008, 12:29 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 10-30-2008, 12:31 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 11-01-2008, 06:21 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 11-01-2008, 10:18 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 11-03-2008, 05:51 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 12-11-2008, 04:32 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 12-27-2008, 02:53 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 12-29-2008, 01:48 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 12-29-2008, 01:59 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 12-29-2008, 02:44 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 12-29-2008, 03:05 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-22-2009, 05:50 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-25-2009, 06:58 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-25-2009, 07:06 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-25-2009, 07:51 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-25-2009, 08:06 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-26-2009, 01:52 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 02-26-2009, 09:56 AM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 09-19-2009, 01:52 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 01-11-2010, 02:49 PM
EzAuth 0.6 - The Easiest User Management System for CI - by El Forum - 06-16-2010, 12:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB