Welcome Guest, Not a member yet? Register   Sign In
how can i run this query in code igniter
#2

[eluser]CroNiX[/eluser]
Code:
$this->db
  ->select('roleID, permID')
  ->select('count(*) as NumDuplicates', FALSE)
  ->group_by(array('roleID', 'permID'))
  ->having('NumDuplicates > 1')
  ->get('role_perms')
  ->result();
Code:
//Produces
SELECT roleID, permID, count(*) as NumDuplicates
FROM (role_perms)
GROUP BY roleID, permID
HAVING NumDuplicates > 1

Haven't tried it as I don't have your tables, but probably something like that


Messages In This Thread
how can i run this query in code igniter - by El Forum - 10-02-2014, 06:59 AM
how can i run this query in code igniter - by El Forum - 10-02-2014, 01:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB