a_bertrand Posted May 22, 2012 Share Posted May 22, 2012 Ok I see the wrapper for insert and simple selects, but no way I see it for a complex joined query or you will end up making like an ORM or something similar. Not a piece of code you do in a couple of hours to make it right. Maybe you should check some of the existing PHP frameworks which already provides you such kind functionality. Quote Link to comment Share on other sites More sharing options...
Aventro Posted May 22, 2012 Author Share Posted May 22, 2012 Ok I see the wrapper for insert and simple selects, but no way I see it for a complex joined query or you will end up making like an ORM or something similar. Not a piece of code you do in a couple of hours to make it right. Maybe you should check some of the existing PHP frameworks which already provides you such kind functionality. True :) I'd better off looking If I can find anything. Thanks for the headsup Well correct me if I'm wrong, but isn't PDO a database wrapper on the framework/php level where I suggested an database wrapper on the application layer? Both will have their advantages, to me it doesn't matter that much as I was simply providing an explanation of what I meant. I intended to write another answer to you, but I forgot about it, I'd just thank you for your post and suggestion, I'd think over it! Quote Link to comment Share on other sites More sharing options...
Spudinski Posted May 22, 2012 Share Posted May 22, 2012 Ok I see the wrapper for insert and simple selects, but no way I see it for a complex joined query or you will end up making like an ORM or something similar. Not a piece of code you do in a couple of hours to make it right. Maybe you should check some of the existing PHP frameworks which already provides you such kind functionality. Well, since you're going on about "complex" queries... There's a very simple way I've seen this being solved. Take for example: $query = array( 'select' => 'CONCAT(), IFNULL(), somewhere.something AS some', 'from' => 'blah bl LEFT JOIN blah () as blah CROSS JOIN as b', 'where' => 'some LIKE \'bla%\'' ); In it's simplest form, you pass the array to the database abstraction layer and each driver will interpret the query as needed. I've created many "complex" queries this way, as it's also useful for switching where clauses and filters. Quote Link to comment Share on other sites More sharing options...
Aventro Posted May 24, 2012 Author Share Posted May 24, 2012 I am going to begin some with the code today, I'd start off setting up the core files and libraries such as config, init, index, autoloaders, smarty, error handling, etcetera. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.