Welcome Guest, Not a member yet? Register   Sign In
DB - Active Record issue with escaping
#1

[eluser]hendrik[/eluser]
In CI 1.6 I used the following code which worked fine:

Code:
$this->db->select('lists.*, properties.createdAt');
$this->db->join('lists', 'lists.id = properties.id');
$query = $this->db->get('properties');

After upgrading to CI 1.7 it doesn't work anymore and gives me the error:

Code:
A Database Error Occurred

Error Number: 1054

Unknown column 'dc_lists.*' in 'field list'

SELECT `dc_lists`.`*`, `dc_properties`.`createdAt` FROM (`dc_properties`) JOIN `dc_lists` ON `dc_lists`.`id` = `dc_properties`.`id`

I've tried passing the 2nd parameter 'FALSE'

Code:
$this->db->select('lists.*, properties.createdAt');

which fixes the problem but I'm concerned that the call isn't as secure anymore as the resulting query is (without escapes):

Code:
SELECT dc_lists.*, dc_properties.createdAt FROM (dc_properties) JOIN dc_lists ON dc_lists.id = dc_properties.id

Any ideas?

Thanks


Messages In This Thread
DB - Active Record issue with escaping - by El Forum - 02-02-2009, 03:58 AM
DB - Active Record issue with escaping - by El Forum - 02-02-2009, 08:20 AM
DB - Active Record issue with escaping - by El Forum - 02-02-2009, 08:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB