MySQL Wrapper Class

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
php_east
Forum Contributor
Posts: 453
Joined: Sun Feb 22, 2009 1:31 pm
Location: Far Far East.

MySQL Wrapper Class

Post by php_east »

i was looking for a convenient db wrapper, and found one

# Name: database.class.php
# File Description: MySQL Class to allow easy and clean access to common mysql commands
# Author: ricocheting
# Web: http://www.ricocheting.com/scripts/
# Update: 2/2/2009
# Version: 2.1
# Copyright 2003 ricocheting.com

i does not quite suite my wishes so i am starting to modify it slightly and am coming up with a enhanced version, though the original already wrap mysql quite nicely.

what i want is an efficient db wrapper, where almost everything will be accesible within its class. is anyone going the same way ? can we share notes ?
public use license.

thanks.
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Re: MySQL Wrapper Class

Post by William »

You might want to add the ability to connect to multiple database servers in the same instance. A good example is when you work on an application that starts to really grow you'll want to be able to send INSERT/UPDATE/DELETE (writes) query's to a master server and your SELECTS (reads) to a slave. Basically add the ability to send query's to multiple servers not just one.

Edit: You also might want to add something like...

Code: Select all

if (!$this->link_id) $this->connect();
in your query function that way you don't have to worry about running connect() before you do query's and you only connect when you actually need to send a query.

Those are just two things off the top of my head. Don't have time to really dive into it right now. Good luck!
Last edited by William on Wed Mar 18, 2009 6:31 pm, edited 1 time in total.
DevGiven
Forum Newbie
Posts: 7
Joined: Wed Mar 04, 2009 5:41 pm

Re: MySQL Wrapper Class

Post by DevGiven »

I used oomysqlwrapper and I was satisfied by the functions they offer.
Post Reply