![]() |
Using same code with different databases like MySQL and PostgreSQL - 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: Using same code with different databases like MySQL and PostgreSQL (/showthread.php?tid=33128) |
Using same code with different databases like MySQL and PostgreSQL - El Forum - 08-16-2010 [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 Using same code with different databases like MySQL and PostgreSQL - El Forum - 08-16-2010 [eluser]WanWizard[/eluser] Read the user guide section on active record. That should generate portable code. Using same code with different databases like MySQL and PostgreSQL - El Forum - 08-16-2010 [eluser]jsherk[/eluser] Yes, that's seems to be the equivalent of (or similar to) PDO ... thanks! |