Liquid Fire Posted March 13, 2008 Share Posted March 13, 2008 I have a database class i am working on as part of my framework and have a small issue. I am using the PDO object which helps a lot in making the database work with multiple database software easily however there a several function i have where i am going to need to do a switch of the database type and it seem that there should be a way then having this switch statement in each of these functions. is there a way where i can extract that code so i do not have to rewrite it for every function that needs it. Link to comment https://forums.phpfreaks.com/topic/95898-switch-issue/ Share on other sites More sharing options...
trq Posted March 13, 2008 Share Posted March 13, 2008 You should only ever need to choose your database driver (once) when you first initiate the PDO object. Link to comment https://forums.phpfreaks.com/topic/95898-switch-issue/#findComment-490958 Share on other sites More sharing options...
Liquid Fire Posted March 13, 2008 Author Share Posted March 13, 2008 well the common function i think are the same but what about the syntax for getting table information, seeing if a table exists, getting list of tables, getting primary key, getting relationships, getting indexes, adding/removing indexes, adding/removing relationships, tables, fields, etc... hell i am not even sure if my insert/update statement are the same in all table as i have only every worked in mysql. I just i need a way to see all the different common statements in the different database software. Link to comment https://forums.phpfreaks.com/topic/95898-switch-issue/#findComment-490975 Share on other sites More sharing options...
trq Posted March 13, 2008 Share Posted March 13, 2008 You just need to stick to the standard ANSI/SQL wherever possible and don't rely on any features of a particular DBMS system. If your not sure what standard SQL looks like, youve got some googling to do. Its an entire language and isn't going to be easily described in a forum reply. Link to comment https://forums.phpfreaks.com/topic/95898-switch-issue/#findComment-490990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.