Welcome Guest, Not a member yet? Register   Sign In
Query escaping not working, or am I doing it wrong?
#1

[eluser]Unknown[/eluser]
I'm trying the following query:
Code:
$this->db->select('ROUND(SUM(amount) / 100, 2) as amount', FALSE);
but it comes out as
Code:
ROUND(SUM(amount) / 100, `2)` as amount
I tried spaces, quotes, backticks, pulling my hair out, but I can't get it to work.

To solve, I think I could write this part as plain SQL. But this is part of a bigger query. Can I combine CI-based query ($this->db->select_sum('payers')Wink with that? Thanks in advance!




Theme © iAndrew 2016 - Forum software by © MyBB