Jump to content
MakeWebGames

Suggestions to a version 2.0


Aventro

Recommended Posts

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...