  BLOBs for PHPLIB
  Sascha Schumann, sascha@schumann.cx
  $Date: 1999/07/17 10:53:51 $, $Revision: 1.5 $

  RFD on a BLOB API for PHPLIB

  11..  BBLLOOBB ((BBiinnaarryy LLaarrggee OOBBjjeeccttss))

  This chapter is intended to give you a quick introduction to BLOBs,
  their interface as proposed for PHPLIB.


  11..11..  DDeeffiinniinngg tthhee pprroobblleemm

  Achieving the goal of creating portable applications is hindered by
  the fact that no portable way of storing large amount of data exists.

  Every database vendor defines his own application programming
  interface (API) to access binary large objects, or uses other, non-
  standard ways to enable the use of BLOBs.

  Enhancing the existing vendor neutral support for databases in PHPLIB
  to also include BLOB support could be a short-term solution to the
  problem.


  11..22..  PPrrooppoosseedd eexxtteennssiioonn AAPPII


  An overview over the function calls follows.


     bblloobb__ccrreeaattee(())

        This will create a new BLOB and return its ID. If it is
        impossible to create a new BLOB, this function will halt() the
        execution and generate an error message.


     bblloobb__ooppeenn(($$IIDD))

        Opens the specified BLOB for reading and writing and returns
        true or false on success or failure, respectively.


     bblloobb__cclloossee(($$IIDD))

        Closes the referenced BLOB. Do not forget this - it might be
        necessary for some databases or you might face data loss.


     bblloobb__ddeelleettee(($$IIDD))

        Deletes the specified BLOB. All associated resources are freed.
        The BLOB must not be referenced at a later time.


     bblloobb__rreeaadd(($$IIDD))

        Reads the entire data of BLOB and returns it.


     bblloobb__wwrriittee(($$IIDD,, $$DDAATTAA))

        Overwrites the whole BLOB with $DATA.

  11..33..  DDeessiiggnn nnootteess

  The goal was to create a vendor neutral API which could be implemented
  easily with most databases. Eventually, it should provide a "fallback"
  mode enabling the user to utilize BLOBs even if the database does not
  support BLOBs natively. Keep in mind that it should be able to cover
  as many databases as possible and therefore only implements a subset
  of functionality provided by modern databases.


























































