Welcome Guest, Not a member yet? Register   Sign In
Select fields being escaped wrong
#1

[eluser]adamp1[/eluser]
Now I'm trying to create a SQL query using active record. But the SQL query being created is wrong, it escapes the wrong bits.
Code:
$this->db->select("page.*, user.name");
$this->db->from("page");
$this->db->join("user","page.user = user.id");
$query = $this->db->get();

This outputs with the following error:
Code:
Error Number: 1054

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

SELECT `page`.`*`, `user`.`name` FROM `page` JOIN `user` ON `page`.`user` = `user`.`id`

Now if I run this as a SQL query manually but removed the quotes from around `page`.`*` so it is just page.* it works fine.

There wasn't a problem with CI 1.6.3 but as soon as I upgraded to CI 1.7 it breaks.
#2

[eluser]Derek Allard[/eluser]
Are you still seeing this error (after an update?)
#3

[eluser]adamp1[/eluser]
This was still happening with version 1.7, I haven't tried the version from SVN
#4

[eluser]adamp1[/eluser]
I have just tried this again, using 1.7.1 and it seems this has been resolved. Great work EllisLab, ty




Theme © iAndrew 2016 - Forum software by © MyBB