Database abstraction for PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ruby Tuesday

    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


  • Phil Roberts

    #2
    Re: Database abstraction for PHP

    With total disregard for any kind of safety measures "Ruby
    Tuesday" <rubytuezdayz@y ahoo.com> leapt forth and uttered:
    [color=blue]
    > 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
    >
    >
    >[/color]

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

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

    Comment

    • Ruby Tuesday

      #3
      Re: Database abstraction for PHP

      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" <philrob@HOLYfl atnetSHIT.net> wrote in message
      news:Xns948EE9B 5676F4philrober ts@216.196.97.1 32...[color=blue]
      > With total disregard for any kind of safety measures "Ruby
      > Tuesday" <rubytuezdayz@y ahoo.com> leapt forth and uttered:
      >[color=green]
      > > 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
      > >
      > >
      > >[/color]
      >
      > Define "better". They're all perfectly fine for dynamic websites...
      >
      > --
      > Phil Roberts | Nobody In Particular | http://www.flatnet.net/[/color]


      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: Database abstraction for PHP

        "Ruby Tuesday" <rubytuezdayz@y ahoo.com> wrote in message news:<c0jfds$17 q3ro$1@ID-205437.news.uni-berlin.de>...[color=blue]
        > 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[/color]

        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_arr ay();
        //...
        }
        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

        Comment

        • Adams-Blake Company

          #5
          Re: Database abstraction for PHP

          Ruby Tuesday wrote:
          [color=blue]
          > 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[/color]

          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
          ***

          Comment

          • Chung Leong

            #6
            Re: Database abstraction for PHP

            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" <ng4rrjanbiah@r ediffmail.com> napisal w
            wiadomosci news:abc4d8b8.0 402132303.4797b 48d@posting.goo gle.com...[color=blue]
            > "Ruby Tuesday" <rubytuezdayz@y ahoo.com> wrote in message[/color]
            news:<c0jfds$17 q3ro$1@ID-205437.news.uni-berlin.de>...[color=blue][color=green]
            > > 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[/color]
            >
            > 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_arr ay();
            > //...
            > }
            > 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[/color]


            Comment

            • Ruby Tuesday

              #7
              Re: Database abstraction for PHP

              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" <rubytuezdayz@y ahoo.com> wrote in message
              news:c0jfds$17q 3ro$1@ID-205437.news.uni-berlin.de...[color=blue]
              > 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
              >
              >[/color]


              Comment

              • Manuel Lemos

                #8
                Re: Database abstraction for PHP

                Hello,

                On 02/16/2004 03:26 AM, Ruby Tuesday wrote:[color=blue]
                > 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[/color]

                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:



                Find all about Metastorage here:




                --

                Regards,
                Manuel Lemos

                PHP Classes - Free ready to use OOP components written in PHP
                Free PHP Classes and Objects 2025 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


                PHP Reviews - Reviews of PHP books and other products


                Metastorage - Data object relational mapping layer generator

                Comment

                • Tony Marston

                  #9
                  Re: Database abstraction for PHP

                  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


                  Tony Marston
                  This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL


                  "Ruby Tuesday" <rubytuezdayz@y ahoo.com> wrote in message
                  news:c0pnqa$19i lps$1@ID-205437.news.uni-berlin.de...[color=blue]
                  > 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" <rubytuezdayz@y ahoo.com> wrote in message
                  > news:c0jfds$17q 3ro$1@ID-205437.news.uni-berlin.de...[color=green]
                  > > 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
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  • Phil Roberts

                    #10
                    Re: Database abstraction for PHP

                    With total disregard for any kind of safety measures "Ruby
                    Tuesday" <rubytuezdayz@y ahoo.com> leapt forth and uttered:
                    [color=blue]
                    > 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[/color]

                    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/

                    Comment

                    Working...