Projects / Zebra_Database


Zebra_Database is an advanced, compact (one-file only), lightweight, object-oriented MySQL database wrapper built upon PHP’s MySQL extension. It provides methods for interacting with MySQL databases that are more powerful and intuitive to use than PHP’s default ones. It supports transactions and provides ways for caching query results either by saving cached data on the disk, or by using memcache.The class provides a comprehensive debugging interface with detailed information about the executed queries: execution time, returned/affected rows, excerpts of the found rows, error messages, etc. It also automatically EXPLAIN‘s each SELECT query (so you don’t miss those keys again). It encourages developers to write maintainable code and provides a better default security layer by automatically escaping strings. Zebra_Database‘s code is heavily commented and generates no warnings, errors, or notices when PHP’s error reporting level is set to E_ALL.

Operating Systems

Recent releases

  •  09 Apr 2012 06:30

    Release Notes: The select() method took arguments in a different order than specified in the documentation; note that this update made the select() method backward incompatible, and that you will have to change the order of the arguments for this to work. Some bugs with the update() and insert_update() methods have been fixed. A bug that most likely appeared since 2.7 with the "seek" method (and any method relying on it, like all the “fetch” methods) has been fixed. A bug where NULL could not be used in the "replacements" array of a query has been fixed.

    •  07 Jan 2012 16:56

      Release Notes: This release adds support for caching query results using memcache, fixes a bug which caused the script to crash if the object was instantiated more than once and the language method was called for each of the instances, completely rewrites the dlookup method, which was not working correctly if anything other than a comma-separated list of column names was used (like an expression, for example), and lets the "connect" method take an additional argument instructing it to connect to the database right away rather than using a "lazy" connection.

      •  03 Sep 2011 21:05

        Release Notes: The name of the "get_columns" method was changed to "get_table_columns", as it returned the number of columns in a given table. A new "get_columns" method was added, which takes as argument a resource and returns the number of columns in the given resource. Some clarifications in the documentation were also made.

        •  02 Jul 2011 04:04

          Release Notes: This released added a "get_link" method, which returns the MySQL link identifier associated with the current connection to the MySQL server. This is necessary because the library uses "lazy connection", so there is no link identifier available when calling the connect method. The insert and insert_bulk methods have a new argument for creating INSERT IGNORE queries which will skip records that would cause a duplicate entry for a primary key. The default value of the "debug" property was set to FALSE.

          •  20 Jun 2011 07:06

            Release Notes: A bug was fixed in the insert_bulk method. A new method was added, called table_exists, which checks to see if a table with the name given as argument exists in the database. The select method now also accepts limit and order arguments; due to this change, this method is not compatible with previous versions. Some documentation refinements were made.


            Project Spotlight


            A Fluent OpenStack client API for Java.


            Project Spotlight

            TurnKey TWiki Appliance

            A TWiki appliance that is easy to use and lightweight.