Welcome Guest, Not a member yet? Register   Sign In
How to compare two columns in a JOIN with CI
#3

[eluser]zyzzzz[/eluser]
I believe ActiveRecord just makes things more difficult, I've stopped using it in my code.
Use something like this:
Code:
$sql = 'SELECT * FROM table WHERE something = ? AND somethingelse = ?';
$bindings = array($value_1, $value2);
$results = $this->db->query($sql, $bindings)->result_array();

You know exactly what the code is doing and using that bindings array will automagically make everything safe.


Messages In This Thread
How to compare two columns in a JOIN with CI - by El Forum - 08-28-2009, 01:37 PM
How to compare two columns in a JOIN with CI - by El Forum - 08-28-2009, 02:21 PM
How to compare two columns in a JOIN with CI - by El Forum - 08-30-2009, 12:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB