468,249 Members | 1,513 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,249 developers. It's quick & easy.

Database abstraction for PHP

Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase, http://www.phpclasses.org/browse.html/package/20.html
c.. PEAR::DB, http://pear.php.net/manual/en/core.db.php
d.. PHPLib database wrappers, http://sourceforge.net/projects/phplib
Jul 17 '05 #1
9 1885
With total disregard for any kind of safety measures "Ruby
Tuesday" <ru**********@yahoo.com> leapt forth and uttered:
Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase,
http://www.phpclasses.org/browse.html/package/20.html c..
PEAR::DB, http://pear.php.net/manual/en/core.db.php d.. PHPLib
database wrappers, http://sourceforge.net/projects/phplib


Define "better". They're all perfectly fine for dynamic websites...

--
Phil Roberts | Nobody In Particular | http://www.flatnet.net/
Jul 17 '05 #2
For those who are familiar with all the below, which one is the easiest(and
using the smallest amount coding) to build a descent looking(with images and
forms) dynamic websites that is using MySQL/PHP/Apache.

Thanks

"Phil Roberts" <ph*****@HOLYflatnetSHIT.net> wrote in message
news:Xn*************************@216.196.97.132...
With total disregard for any kind of safety measures "Ruby
Tuesday" <ru**********@yahoo.com> leapt forth and uttered:
Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase,
http://www.phpclasses.org/browse.html/package/20.html c..
PEAR::DB, http://pear.php.net/manual/en/core.db.php d.. PHPLib
database wrappers, http://sourceforge.net/projects/phplib


Define "better". They're all perfectly fine for dynamic websites...

--
Phil Roberts | Nobody In Particular | http://www.flatnet.net/

Jul 17 '05 #3
"Ruby Tuesday" <ru**********@yahoo.com> wrote in message news:<c0*************@ID-205437.news.uni-berlin.de>...
Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase, http://www.phpclasses.org/browse.html/package/20.html
c.. PEAR::DB, http://pear.php.net/manual/en/core.db.php
d.. PHPLib database wrappers, http://sourceforge.net/projects/phplib


In the company I work for, we're preparing some framework for our
projects. When we tried the above, we find that they all go for "too
much" abstraction---which is somewhat messy. Say for example, they
check the choosen DB and then use the appropriate function for that
DB.

If you like procedural style, you better to go for
<http://in2.php.net/dbx>

For us, we decided to go for our simple abstraction so that when
to switch to another DB, just it is enough to touch the class alone.

Example:

class DB
{
//var ...
function DB() ///constructor
{
///...
}
function dbConnect()
{
mysql_connect(); // or pg_connect(); or whatever
//...
}
function dbClose()
{
mysql_close(); // or pg_close(); or something else
//...
}
function dbQuery()
{
mysql_query();
//...
}
function dbFetchArray()
{
mysql_fetch_array();
//...
}
function dbGetError()
{
mysql_error();
}
function dbGetErrno()
{
mysql_errno();
}
}

--
"Success = 10% sweat + 90% tears"
If you live in USA, please support John Edwards.
Email: rrjanbiah-at-Y!com
Jul 17 '05 #4
Ruby Tuesday wrote:
Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase, http://www.phpclasses.org/browse.html/package/20.html
c.. PEAR::DB, http://pear.php.net/manual/en/core.db.php
d.. PHPLib database wrappers, http://sourceforge.net/projects/phplib


We have had outstanding success with the ADODB package for our JAYA123
order-entry, invoicing web-service (http://www.jaya123.com). We tried the
fist three and thought all did a good job, were fast, easy to use, simple to
install, etc. We chose ADODB because it had some classes that allowed syntax
that was similar to how Microsoft Jet is coded and we have a lot of
experience on that platform from past lives, so our learning curve was a bit
flatter. I highly recommend ADODB, but the others are fine as well. I think
it will come down to personal preference. Try them all... there is no wrong
answer here IMO. YMMV.

Al Canton, Vice President
Adams-Blake Company, Inc.
***
JAYA123 - the new web-based total-office system for the
small biz. Order entry, billing, bookkeeping, etc. for $14.95
a month. Everyone says "It's cool as a moose!!"
See why at:http://www.jaya123.com
***

Jul 17 '05 #5
In my case they provide too little abstraction. I wanted to isolate the
database, queries et al, completely from the application code. For my own
abstraction layer, it was more straight forward to call the PHP functions
directly.

Uzytkownik "R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> napisal w
wiadomosci news:ab**************************@posting.google.c om...
"Ruby Tuesday" <ru**********@yahoo.com> wrote in message

news:<c0*************@ID-205437.news.uni-berlin.de>...
Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase, http://www.phpclasses.org/browse.html/package/20.html
c.. PEAR::DB, http://pear.php.net/manual/en/core.db.php
d.. PHPLib database wrappers, http://sourceforge.net/projects/phplib


In the company I work for, we're preparing some framework for our
projects. When we tried the above, we find that they all go for "too
much" abstraction---which is somewhat messy. Say for example, they
check the choosen DB and then use the appropriate function for that
DB.

If you like procedural style, you better to go for
<http://in2.php.net/dbx>

For us, we decided to go for our simple abstraction so that when
to switch to another DB, just it is enough to touch the class alone.

Example:

class DB
{
//var ...
function DB() ///constructor
{
///...
}
function dbConnect()
{
mysql_connect(); // or pg_connect(); or whatever
//...
}
function dbClose()
{
mysql_close(); // or pg_close(); or something else
//...
}
function dbQuery()
{
mysql_query();
//...
}
function dbFetchArray()
{
mysql_fetch_array();
//...
}
function dbGetError()
{
mysql_error();
}
function dbGetErrno()
{
mysql_errno();
}
}

--
"Success = 10% sweat + 90% tears"
If you live in USA, please support John Edwards.
Email: rrjanbiah-at-Y!com

Jul 17 '05 #6
Thanks to all. Perhaps anyone can narrow it down to just one or two
selection where I can do the following easily:

- database search, add, replace, edit ..
- database paging of the result set
- have a nice(don't have to be fancy) forms display
- easily maintain
- less coding
etc

Thanks
"Ruby Tuesday" <ru**********@yahoo.com> wrote in message
news:c0*************@ID-205437.news.uni-berlin.de...
Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase, http://www.phpclasses.org/browse.html/package/20.html
c.. PEAR::DB, http://pear.php.net/manual/en/core.db.php
d.. PHPLib database wrappers, http://sourceforge.net/projects/phplib

Jul 17 '05 #7
Hello,

On 02/16/2004 03:26 AM, Ruby Tuesday wrote:
Thanks to all. Perhaps anyone can narrow it down to just one or two
selection where I can do the following easily:

- database search, add, replace, edit ..
- database paging of the result set
- have a nice(don't have to be fancy) forms display
- easily maintain
- less coding
etc


I think you want something that goes beyhond just database abstraction.

You may want to try Metastorage. This is a tool that will generate data
access object classes from a simple data model definition. It wraps you
database tables into classes as if the your table rows were objects of
those classes.

Metastorage also generates classes that installs the database schema for
you as well generate forms that handle common types of manipulations
like creating new objects (table row entries).

Forms presentation is defined from themes that can be chosen from a
pre-defined selection that makes your Web forms look like familiar
desktop OS applications or you can design your own with your templates.

As a bonus, it generates nice UML class diagrams to let you make a good
impression your boss or your clients.

Take a look at the screenshots here:

http://www.meta-language.net/screenshots.html

Find all about Metastorage here:

http://www.meta-language.net/metastorage.html
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #8
If you are interested in the 3 tier architecture where the presentation,
business and data access layers are all separate then have a look at
http://www.tonymarston.co.uk/php-mys...plication.html

Tony Marston
http://www.tonymarston.net

"Ruby Tuesday" <ru**********@yahoo.com> wrote in message
news:c0*************@ID-205437.news.uni-berlin.de...
Thanks to all. Perhaps anyone can narrow it down to just one or two
selection where I can do the following easily:

- database search, add, replace, edit ..
- database paging of the result set
- have a nice(don't have to be fancy) forms display
- easily maintain
- less coding
etc

Thanks
"Ruby Tuesday" <ru**********@yahoo.com> wrote in message
news:c0*************@ID-205437.news.uni-berlin.de...
Which one is better to do dynamic websites using MySQL? Thanks

a.. ADODB, http://php.weblogs.com/ADOdb/
b.. Metabase, http://www.phpclasses.org/browse.html/package/20.html
c.. PEAR::DB, http://pear.php.net/manual/en/core.db.php
d.. PHPLib database wrappers, http://sourceforge.net/projects/phplib


Jul 17 '05 #9
With total disregard for any kind of safety measures "Ruby
Tuesday" <ru**********@yahoo.com> leapt forth and uttered:
Thanks to all. Perhaps anyone can narrow it down to just one or
two selection where I can do the following easily:

- database search, add, replace, edit ..
- database paging of the result set
- have a nice(don't have to be fancy) forms display
- easily maintain
- less coding
etc

Thanks


For those kind of features it might be worth checking out the Web
Application Component Toolkit project http://wact.sourceforge.net/

It features some nice database abstraction, provides a
compatibility layer for both PEAR::DB and ADODB, has a Paging
feature and has a very cool template engine. You can implement a
paged recordset with only a few lines of PHP code.

--
Phil Roberts | Nobody In Particular | http://www.flatnet.net/
Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by SectorUnknown | last post: by
1 post views Thread by DartmanX | last post: by
25 posts views Thread by Colin McKinnon | last post: by
1 post views Thread by rickycornell | last post: by
8 posts views Thread by Ivan S | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.