Xeoncross Posted September 8, 2008 Share Posted September 8, 2008 This package extends the PDO object to provide DB abstraction - a simple way to query different types of databases without needing to change your code. PDO: PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility. - http://php.net/manual/en/intro.pdo.php However PDO does not cover DB query-abstraction - for that you have to use some huge class like ADOdb or PEAR:DB. Which of course will slow your site to a crawl if you are using shared hosting. This class fills this gap and provides DB query-abstraction for common functions like SELECT, REPLACE, INSERT, UPDATE, and DELETE queries. The actual PDO object is not changed in anyway - each of these functions still returns a PDO Statement Object. The total package size is only 18kb! And that is with LOTS of comments explaining the code! It is the missing link for people who love the DATA abstraction PDO provides but also need QUERY abstraction. Currently it only works on SQLite2-3 and MySQL. However because it is built for the SQL language - it will be supper simple to add PostgreSQL or MSSQL support as well (copy mysql class and change 3-5 functions). I just don't have a copy of either DB up and running to test it. http://code.google.com/p/cxpdo/ I would love it if people would download the package and run index.php which will create a sample SQLite DB and demonstrate how easy this class is to use. Link to comment https://forums.phpfreaks.com/topic/123300-lightweight-php-pdo-abstraction-library-query-abstraction/ Share on other sites More sharing options...
corbin Posted September 9, 2008 Share Posted September 9, 2008 Hrmmmm..... Question: If it's over layed on PDO, why are you using PHP4-style OOP? Link to comment https://forums.phpfreaks.com/topic/123300-lightweight-php-pdo-abstraction-library-query-abstraction/#findComment-637131 Share on other sites More sharing options...
Xeoncross Posted September 10, 2008 Author Share Posted September 10, 2008 Question: If it's over layed on PDO, why are you using PHP4-style OOP? Because I had to downgrade it to make it compatible with the Codigniter framework :-\ Link to comment https://forums.phpfreaks.com/topic/123300-lightweight-php-pdo-abstraction-library-query-abstraction/#findComment-638451 Share on other sites More sharing options...
corbin Posted September 12, 2008 Share Posted September 12, 2008 Codeigniter is PHP4? Ewww. Link to comment https://forums.phpfreaks.com/topic/123300-lightweight-php-pdo-abstraction-library-query-abstraction/#findComment-639495 Share on other sites More sharing options...
Xeoncross Posted September 12, 2008 Author Share Posted September 12, 2008 Codeigniter is PHP4? Ewww. CI is PHP4,5,6 compatible. Once more than 80% of the world FINNNNNNNNNNNNNNNALLY switches to PHP5-6 (i.e. non php people using php products) then they are going to delete the PHP4 part. Link to comment https://forums.phpfreaks.com/topic/123300-lightweight-php-pdo-abstraction-library-query-abstraction/#findComment-639783 Share on other sites More sharing options...
corbin Posted September 12, 2008 Share Posted September 12, 2008 I would've done away with the PHP4 part a long time ago. Then again, I'm not a fan of products that are as old as PHP4 is (when compared with newer products, as in this case). Anyway, gotta do what ya gotta do, even if it does mean PHP4-style x.x. Link to comment https://forums.phpfreaks.com/topic/123300-lightweight-php-pdo-abstraction-library-query-abstraction/#findComment-640191 Share on other sites More sharing options...
Recommended Posts