Round brackets issue in Codeigniter |
The issue you are facing is because the Codeigniter query builder is adding round brackets around the table name by default. To prevent this, you can set the "_protect_identifiers" property to false before running the query. Additionally, you can pass "false" as the second parameter to the "from()" method to prevent the table name from being enclosed in brackets. The modified query would look like this:
$this->db->_protect_identifiers = false; $this->db->select('*')->from('tb_card', false); $this->db->where('company_id', $this->company_id, FALSE)->get()->row_array(); This should generate the correct query for MySQL and SQL Server. But, yes if we compare it with the python you can find more similarities in it. |
Messages In This Thread |
Round brackets issue in Codeigniter - by kalyanbl - 03-10-2018, 03:40 AM
RE: Round brackets issue in Codeigniter - by InsiteFX - 03-10-2018, 07:38 AM
RE: Round brackets issue in Codeigniter - by jamesmillere - 01-19-2023, 12:00 AM
RE: Round brackets issue in Codeigniter - by gregbowers - 07-18-2023, 12:10 AM
|