Best Database Class

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    Best Database Class

    Upto now I have used my own Database class.
    It employs an Abstract base class with common functionality and most public functions.
    Inheriting this class are three classes that contain specific functionality for MySQL, SQL Server (mssql) and Access.

    I now find I need the SQL Server functionality of Transactions: BEGIN, COMMIT, ROLLBACK.

    Should I write my own functions with these fairly simple queries or switch to using PDO.
    ADODB seems to carry a bit more overhead. benchmark
    Please don't recommend PEAR as it does not keep up with PHP versions and abandons functions at a whim causing huge problems with legacy code.

    PDO looks good, or can this also cause similar problems I have experienced with PEAR
  • chathura86
    New Member
    • May 2007
    • 227

    #2
    well im using PDO and still seems ok (both portability and performance)

    now im using Doctrine ORM which is very cool
    (Doctrine also uses PDO)

    Regards
    Chathura Bamunusinghe

    Comment

    • code green
      Recognized Expert Top Contributor
      • Mar 2007
      • 1726

      #3
      PDO doesn't look look that promising with MsSQL.
      PDO_DBLIB is not recommended, but PDO_ODBC is.
      ODBC is old school and may not be convenient, particuarly for remote servers

      Comment

      • dlite922
        Recognized Expert Top Contributor
        • Dec 2007
        • 1586

        #4
        Write your own function.

        I just extended my DAO class to have these functions in them that run the simple queries. Been working great for me so far. Backwards compatible, portable, easy to use.



        Dan

        Comment

        • code green
          Recognized Expert Top Contributor
          • Mar 2007
          • 1726

          #5
          Tried using PDO and the current driver PDO_DBLIB does not support transactions, so no use to me.

          Apparently. Microsoft have released a better driver in Apr 2010 that fully supports PDO, but only a Beta version.

          I have written my own Transaction functions, that simply contain the queries
          Code:
          BEGIN TRAN 
          COMMIT TRAN 
          ROLLBACK TRAN
          and they work fine.

          Comment

          Working...