CodeIgniter Forums
Upgrading "system/database" folder breaks my application - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Upgrading "system/database" folder breaks my application (/showthread.php?tid=15874)

Pages: 1 2 3


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]KeyStroke[/eluser]
Hi,

I'm still using an older version of the "system/database" folder files, because everytime I copy newer files to them, I start getting random database errors (like "unknown column" errors).

The files in the database folder are from a 1.6.x version (can't remember which one). Were there any major changes I should be aware of?


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]TheFuzzy0ne[/eluser]
The change log is your best bet. Failing that, a side-by-side comparison of functions.


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]t'mo[/eluser]
The problem described here (http://ellislab.com/forums/viewthread/70698/) broke my stuff on the upgrade from 1.5.* to 1.6.*.

But, like TheFuzzyOne said, your best bet it to check the change log.


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]SitesByJoe[/eluser]
I find that once in a while I need to install a fresh copy of CI - re-add my files to it and "voila!" it works again. This has happened on numerous upgrade instances (I've been using it since 1.3 or 4)

I'm not sure why it happens but it does once in a great while.


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]KeyStroke[/eluser]
Sorry I forgot to mention that I've actually checked the changelog, but noticed nothing "new" there that would break my current code. I'm using active record for most of my queries. I also assumed that a new release wouldn't simply just break an older code.

@SitesByJoe:
Although that might work, it doesn't sound really practical.


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]SitesByJoe[/eluser]
No, its not practical. However, I've had the same thing happen to me several times over several upgrades, over several years. Keep it as your last resort. I've received the same advice from this forum before too.


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]KeyStroke[/eluser]
So which directory do you specifically replace? or is it the whole thing?


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]SitesByJoe[/eluser]
The whole thing...


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]KeyStroke[/eluser]
Whoa! I just found out what was causing the problem:

I had a few 'where' clauses where the values I was trying to match didn't have space between them and the equal sign like this:
Code:
where('user.city_id=city.id')

I just added some spaces in all instances like this:
Code:
where('user.city_id = city.id')

And now it works fine. Really weird. :S


Upgrading "system/database" folder breaks my application - El Forum - 02-17-2009

[eluser]Colin Williams[/eluser]
Hrm.. might be a bug with _protect_identifiers()

Maybe it's escaping the whole thing as a column name, like `user.city_id=city.id`