I am using MysqlDb Class in my Project.
$fromquery = $jdb->where("ac_ag_Id",1)->orWhere("ac_ag_Id",2)->orWhere("ac_ag_Id",4)->orWhere("ac_ag_Id",17)->where("c_Id",$cc_Id)->get("tbl_accounts")
This is my current query and the result is
SELECT * FROM tbl_accounts WHERE ac_ag_Id = '1' OR ac_ag_Id = '2' OR ac_ag_Id = '4' OR ac_ag_Id = '17' AND c_Id = '2'
Here, c_Id
must be 2
, but I am getting result of c_Id
of 1
also. So I added a bracket which looks like this and I get the currect result
SELECT * FROM tbl_accounts WHERE (ac_ag_Id = '1' OR ac_ag_Id = '2' OR ac_ag_Id = '4' OR ac_ag_Id = '17') AND c_Id = '2'
How to get this result form that class like adding function andWhere
or something?