Welcome Guest, Not a member yet? Register   Sign In
Using same code with different databases like MySQL and PostgreSQL
#1

[eluser]jsherk[/eluser]
Prior to discovering CodeIgniter, whenever I write code, I have been using the PDO db connector, which in theory easily makes the code work with your database of choice without having to change anything (other than one line for creating connection).

Is this similar functionality available within CodeIgniter? Can I simply change the dbdriver from "mysql" to "postgres" and my code will now work with that db?

Any helpful explanations on it works appreciated.

Thanks
#2

[eluser]WanWizard[/eluser]
Read the user guide section on active record. That should generate portable code.
#3

[eluser]jsherk[/eluser]
Yes, that's seems to be the equivalent of (or similar to) PDO ... thanks!




Theme © iAndrew 2016 - Forum software by © MyBB