CRUDL class design

closed account (o3hC5Di1)
Hi everyone,

I'm trying to set up a basic class that will perform CRUDL operations (create, read, update, delete, list) as part of a web-app library. Obviously, these operations are very common in web-apps, whether it's users or content you're creating / managing, so it would be an important part of the app and I would like to make sure I get it right. I'm looking for the following functionality:

* Should work with a variety of objects (for instance users and blogposts)
* Should work with prepared statements (so the user-supplied values in the query should be provided separately)
* Preferably it should be capable of handling both single SQL queries as well as multiple (transactions).

I am unsure of the best way to implement this, I have found a lot of PHP examples that try to do stuff like:

db->select(tablename, columns, whereclause, orderby);

But to me that seems restrictive, you might just as well write the actual query that way.

Any thoughts / suggestions would really be greatly appreciated.

Thanks in advance.

All the best,
NwN
Last edited on
closed account (o3hC5Di1)
*polite bump* - Rephrased the question.
closed account (o3hC5Di1)
*polite bump* - moved from beginners to general.
Topic archived. No new replies allowed.