472,962 Members | 2,957 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,962 software developers and data experts.

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 2125
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: lawrence | last post by:
A user writes this sentence: "It was the New Urbanist's nightmare of sprawl run amok." They input that and my PHP script hits it with addslashes() and then the sentence gets put in the database....
3
by: Rainer Collet | last post by:
hi! i tested several php database abstraction layers (db, mdb(2), creole, adodb, etc), but i always missed one really important feature: i need a method for a limited select which gives me the...
13
by: SectorUnknown | last post by:
I've written a database (Access mdb) front-end using Python/wxpython/and ADO. However, the scope of the project has changed and I need to access the same data on an MSSQL server. Also, the...
2
by: David | last post by:
Is there a good DataBase Abstraction layer that will handle the mySql, Sql Server, and MS Access engines? I do not wish to write the same functions with the three different PHP db functions. ...
27
by: Brett | last post by:
If I want to easily swap the database I'm using, what is the best method for developing that tier in my application? I'll have basically a 4 tier app: 1. presentation 2. business logic 3. data...
1
by: DartmanX | last post by:
I'm looking for any comparisons of PHP Database Abstraction Layers out there, with an eye towards speed/efficiency. I'm still using PEAR::DB, which obviously leaves something to be desired. I'm...
25
by: Colin McKinnon | last post by:
Hi all, There's lots of DB abstraction layers out there, but a quick look around them hasn't turned up anything which seems to met my requirements. Before I go off and write one I thought I'd...
1
by: rickycornell | last post by:
Greetings All, On past projects in PHP4 I had always just written my own libraries to deal with database interaction. Somehow I was operating in the dark that there were all these database...
8
by: Ivan S | last post by:
What are your recommendations for lightweight database abstraction library (Oracle/MySQL)? I prefer OOP. :) Tnx, Ivan.
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.