[eluser]codex[/eluser]
Try this:
Code:
$this->db->select('COUNT(*) AS total_count');
$this->db->from('authorize_net');
$this->db->where('Transaction Status', 'Settled Successfully');
$this->db->where('Settlement Amount', '9.95');
$query = $this->db->get();
$result = $query->result();
$this->total_count_dvd = $result;
But are your fields really called Transaction Status and Settlement Amount? That can't be right...
[quote author="dplgngr" date="1256067135"][quote author="rogierb" date="1256065850"]around "Settled Successfully". Mysql does not support them.[/quote]
Code:
$this->db->where('`Transaction Status`="Settled Successfully" and `Settlement Amount`=9.95');
Can you suggest the exact code?
I tried this one:
Code:
$this->db->select('COUNT(*) AS total_count');
$this->db->from('authorize_net');
$this->db->where('`Transaction Status`=`Settled Successfully` and `Settlement Amount`=9.95');
$query = $this->db->get();
$result = $query->result();
$this->total_count_dvd = $result;
but it returned an error:
Code:
A Database Error Occurred
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Status`=`Settled Successfully` and `Settlement Amount`=9.95' at line 3
SELECT COUNT(*) AS total_count FROM (`authorize_net`) WHERE `Transaction` Status`=`Settled Successfully` and `Settlement Amount`=9.95
[/quote]