Welcome Guest, Not a member yet? Register   Sign In
Upgrading "system/database" folder breaks my application
#11

[eluser]KeyStroke[/eluser]
Yea that could be it, since the errors I was getting were "unknown column" errors.
#12

[eluser]Colin Williams[/eluser]
Or even something really whacky like `user`.`city_id`.`=`.`city`.`id`

Might be interesting to debug the query and see what's up.
#13

[eluser]TheFuzzy0ne[/eluser]
Hopefully this is a solution to [url="http://ellislab.com/forums/viewthread/105175/"]this thread[/url], started by [url="http://ellislab.com/forums/member/40351/"]SitesByJoe[/url].
#14

[eluser]Colin Williams[/eluser]
I'm not a SQL genius, but is "user.city_id=city.id" valid SQL? Or does it break some SQL conventions? If not, this should probably marked a bug once more info about it is known.
#15

[eluser]TheFuzzy0ne[/eluser]
It's the only way I know of to perform a natural join between two tables.
#16

[eluser]KeyStroke[/eluser]
he meant when there are no spaces between the column names and the equal sign.
#17

[eluser]Colin Williams[/eluser]
Right, KeyStroke. Thanks for clearing it up. That is what I meant.
#18

[eluser]TheFuzzy0ne[/eluser]
Oh, I see. Well it seems to work for me on MySQL 5.
#19

[eluser]KeyStroke[/eluser]
By the way, I was able to reproduce the error with this query:
Code:
$this->db->select('*')->from('user, city')->where('user.city_id=city.id')->get();

Add spaces around the equal sign, and the problem is solved.

Can anyone else verify this?
#20

[eluser]KeyStroke[/eluser]
Oh wait, I just noticed the problem in the error (DUH!!):
Quote:A Database Error Occurred

Error Number: 1054

Unknown column 'user.city_id=city.id' in 'where clause'

SELECT * FROM (`user`, `city`) WHERE `user`.`city_id=city`.`id`
Notice how it's not placing quotes properly in the query (or so it seems). Is this something to be reported? or is that how active record queries suppose to work?




Theme © iAndrew 2016 - Forum software by © MyBB