DbSimple: need your opinion

    Date: 01/23/07 (PHP Community)    Keywords: php, mysql, sql, postgresql

    Recently I translated into English one of my old project, DbSimple (LGPL). It is a DB abstraction library for PHP which could work with MySQL, PostgreSQL, FireBird. The main idea is extremely simple interface: everything which may be done automatically is realized so in DbSimple, and code remains quite readable.

    It would be great if your comment this library (and possibly try). For my projects this library simplifies the work very much, maybe it will be useful for others...

    Some key features:

    • Conditional macro-blocks in SQL body ({}-blocks), which allow to dynamically generate even very complex queries without detriment to code readability.
    • Caching of query results (if necessary).
    • Different fetch methods (as column, as 2d array, as key-based multidimension array, as tree etc.).
    • Supports various placeholder (query arguments) types: list-based, associative, identifier-based etc.
    • Supports operation "select + count total number of resulting rows" (for data displayed page-by-page).
    • Functions for direct fetching: all result rows, one row, one column, one cell, associative array, multi-dimensional associative array, linked tree etc.
    The most interesting synopse (macro-blocks, placeholders, select one page with total counting):

    $rows = $DB->selectPage($totalNumberOfRows, '
    SELECT *
    FROM goods
    WHERE
    category_id IN(?a)
    { AND activated_at > ? }
    LIMIT ?d, ?d
    ',
    $categoryIds,
    (empty($_POST['activated_at'])? DBSIMPLE_SKIP : $_POST['activated_at']),
    $pageOffset, $pageSize
    );

    Other synopsis are at http://en.dklab.ru/lib/DbSimple/#list1

    Source: http://community.livejournal.com/php/532896.html

« PHP w/Eclipse || refresh »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home