in 2.0.x you can still use the db-api:
http://wiki.modxcms.com/index.php/API:DBAPI
but its much more powerfull to use xpdo:
http://rtfm.modx.com/display/revolution20/Using+Custom+Database+Tables+in+your+3rd+Party+Components
see also formit2db in my signature, which uses formit and hook-snippets to create your schema and class-files and to store your form-values to custom-table.
Maybe this is answered somewhere else, but does formit2db work with Revo.?
I think, thererfor I am! But what I am, and why...?
Quote from: Sylvaticus at Feb 11, 2011, 06:13 AM
Maybe this is answered somewhere else, but does formit2db work with Revo.?
yes, only with Revo.
Quote from: jusmeig at Feb 11, 2011, 10:11 AM
Quote from: Bruno17 at Feb 10, 2011, 02:30 AM
in 2.0.x you can still use the db-api: http://wiki.modxcms.com/index.php/API:DBAPI
U can?
db-api-functions are still included in the revo-core.
They are deprecated and will be removed on 2.1
But then it’s easy to create an Extra which gives you back the old db-api.
Quote from: OpenGeek at Oct 18, 2010, 09:25 AM
Quote from: theuros at Oct 18, 2010, 07:16 AM
i’m migrating from evo to revo and i use a lot of custom queries like this from my previous post http://modxcms.com/forums/index.php/topic,55489.msg320194.html#msg320194
I’m used to work with $modx->db->query("SELECT...") class from modx evolution, so my question is what is the future of it? i heard that will be removed in some future version of modx revolution? if that’s true, i want to know how i can implement my own class like $mody->db... into modx so i can use it anywhere i want ?
When the DBAPI is removed from Revolution, it will be made available as an Extra. You can load any external class as a "service" class onto the $modx instance, and this is how it will be accomplished. You will just have to add a call to the $modx->getService() method to register the DBAPI instance and make it available as the $modx->db object.
Using xPDOObjects and schemas means you get the benefit of the xPDOObject API, as well as compatibility in your queries with multiple database platforms.
shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect |
github |
splittingred.com
If it’s a simple table that already exists, you might find it easier to get it ready for xPDO this way:
http://bobsguides.com/custom-db-tables.html.