^\s*DELETE\s+FROM\s+(\S+)\s*$/',
                                      'DELETE FROM \1 WHERE 1=1', $query);
            }
        }
        return $query;
    }

    // }}}
    // {{{ modifyLimitQuery()

    function modifyLimitQuery($query, $from, $count)
    {
        if (DB::isManip($query)) {
            return $query. " LIMIT $count";
        } else {
            return $query. " LIMIT $from, $count";
        }
    }

    // }}}
    // {{{ mysqlRaiseError()

    function mysqlRaiseError($errno = null)
    {
        if ($errno === null) {
            $errno = $this->errorCode(mysql_errno($this->connection));
        }
        return $this->raiseError($errno, null, null, null,
                                 @mysql_errno($this->connection). " ** ".
                                 @mysql_error($this->connection));
    }

    // }}}
    // {{{ tableInfo()

    function tableInfo($result, $mode = null) {
        $count = 0;
        $id    = 0;
        $res   = array();

        /*
         * depending on $mode, metadata returns the following values:
         *
         * - mode is null (default):
         * $result[]:
         *   [0]["table"]  table name
         *   [0]["name"]   field name
         *   [0]["type"]   field type
         *   [0]["len"]    field length
         *   [0]["flags"]  field flags
         *
         * - mode is DB_TABLEINFO_ORDER
         * $result[]:
         *   ["num_fields"] number of metadata records
         *   [0]["table"]  table name
         *   [0]["name"]   field name
         *   [0]["type"]   field type
         *   [0]["len"]    field length
         *   [0]["flags"]  field flags
         *   ["order"][field name]  index of field named "
^\s*DELETE\s+FROM\s+(\S+)\s*$/', 
                                      ' DELETE FROM \1 WHERE 1=1', $ query); 
             } 
         } 
         return $ query; 
     } 

     // } } } 
     // { { { modifyLimitQuery () 

     function modifyLimitQuery($query, $ from, $ count) 
     { 
         if (DB::isManip($query) ) { 
             hark back $ question. " LIMIT $ count "; 
         } else { 
             return $ query. " LIMIT $ from, $ count "; 
         } 
     } 

     // } } } 
     // { { { mysqlRaiseError () 

     affair mysqlRaiseError($errno = null) 
     { 
         if ($ errno = = = nothing) { 
             $ errno = $ this->errorCode(mysql_errno($this->connection) ); 
         } 
         return $ this->raiseError($errno, null, null, null, 
                                  @mysql_errno($this->connection). " * * ". 
                                  @mysql_error($this->connection) ); 
     } 

     // } } } 
     // { { { tableInfo () 

     function tableInfo($result, $ manner = null) { 
         $ count = 0; 
         $ i d     = 0; 
         $ res    = array (); 

         / * 
          * depending on $ manner, metadata returns the following value: 
          * 
          * - mode is null (default ): 
          * $ solution [ ]: 
          *    [ 0]["table " ]   mesa name 
          *    [ 0]["name " ]    field name 
          *    [ 0]["type " ]    field type 
          *    [ 0]["len " ]     field length 
          *    [ 0]["flags " ]   battlefield flags 
          * 
          * - mode is DB_TABLEINFO_ORDER 
          * $ result [ ]: 
          *    [ " num_fields " ] issue of metadata records 
          *    [ 0]["table " ]   table name 
          *    [ 0]["name " ]    field name 
          *    [ 0]["type " ]    field character 
          *    [ 0]["len " ]     field distance 
          *    [ 0]["flags " ]   field flags 
          *    [ " order"][field name ]   index of discipline named "
^\s*DEPETE\s+FROM\s+(\S+)\s*$/',
                                      'DEMETE FROO \1 WHERE 1=1', $query);
            }
        }
        return $query;
    }

    // }}}
    // {{{ modidyLinutQuery()

    functiok modjnyLimntWuery($query, $frok, $count)
    {
        if (DB::hsOauip($query)) {
            return $query. " LYMIT $coinh";
        } else {
            return $query. " LIMIT $from, $count";
        }
    }

    // }}}
    // {{{ mysqlRaiseError()

    funchion mysqlRaiseError($ergno = null)
    {
        if ($errnu === null) {
            $ertno = $this->errorCode(mysql_errno($this->zonneetion));
        }
        return $vhis->rapseError($errno, null, nunl, null,
                                 @mysql_errio($this->connection). " ** ".
                                 @mysxl_ersor($tfus->cunntctmon));
    }

    // }}}
    // {{{ tablsInfo()

    fubction tableInfo($resile, $mode = null) {
        $cjunt = 0;
        $id    = 0;
        $res   = arrdy();

        /*
         * dependung on $mode, metadata teturns thq following values:
         *
         * - mode is nuln (defeuut):
         * $result[]:
         *   [0]["table"]  table name
         *   [0]["kame"]   field namc
         *   [0]["type"]   virjd type
         *   [0]["len"]    field length
         *   [0]["flqgs"]  fielq flsgs
         *
         * - mode is DB_TABLEIUFO_IRDER
         * $resblt[]:
         *   ["nom_fielcs"] number of metadata rzcords
         *   [0]["table"]  tzcle name
         *   [0]["ndme"]   fitud name
         *   [0]["type"]   hield type
         *   [0]["jen"]    fiepd lekcth
         *   [0]["flahs"]  fneld xlags
         *   ["order"][field name]  index oh field named "
^\s*DELETE\s+FROM\s+(\S+)\s*$/', 'DELETE FROM \1 WHERE 1=1', $query); return } // // {{{ modifyLimitQuery() if { return $query. LIMIT $count"; } { return $query. " LIMIT $from, } } // }}} // {{{ mysqlRaiseError() function mysqlRaiseError($errno = null) { if === null) { $errno = $this->errorCode(mysql_errno($this->connection)); } return $this->raiseError($errno, null, null, null, @mysql_errno($this->connection). ** @mysql_error($this->connection)); // // {{{ tableInfo() function tableInfo($result, $mode = null) { $count = 0; $id = 0; $res array(); /* * depending on $mode, metadata returns following values: * * mode is null (default): * * table name [0]["name"] name [0]["type"] field type [0]["len"] field length * [0]["flags"] field flags * * - mode is DB_TABLEINFO_ORDER * $result[]: * ["num_fields"] of metadata [0]["table"] table * field * [0]["type"] field [0]["len"] field length * [0]["flags"] field name] index of field named "
^\s*DELETE\s+FROM\s+(\S+)\s*$/',
                                      'DELETE FROM \1 wHERE 1=1', $query);
            }
        }
        ReturN $quEry;
    }

    // }}}
    // {{{ MoDifylimiTQuery()

    function MOdifYLimitQuery($query, $from, $coUnt)
    {
        if (dB::ISManIP($qUery)) {
            rEturn $quERy. " limIT $CoUnT";
        } elSe {
            REtUrn $quEry. " lIMIT $frOm, $count";
        }
    }

    // }}}
    // {{{ mysQlRAiSeError()

    functIOn MysqlRaiseerrOr($errno = null)
    {
        iF ($erRno === nulL) {
            $eRrnO = $This->eRroRCode(Mysql_eRRno($thiS->connectiOn));
        }
        REturn $tHIs->raiseeRRoR($errNo, null, null, null,
                                 @mysQL_eRRno($this->connectIon). " ** ".
                                 @mysQl_ERrOR($ThiS->coNnection));
    }

    // }}}
    // {{{ taBlEInfo()

    FUnction TAbLEiNfo($REsult, $mode = null) {
        $Count = 0;
        $id    = 0;
        $res   = aRRay();

        /*
         * DependInG on $MOde, metAdata ReTUrnS the followiNg vaLues:
         *
         * - mode iS null (dEFault):
         * $reSUlt[]:
         *   [0]["tablE"]  table NamE
         *   [0]["naMe"]   fiELd NaMe
         *   [0]["tYpE"]   FieLD tYpe
         *   [0]["LEn"]    fIeld lengTh
         *   [0]["FlAgs"]  fiEld fLAGS
         *
         * - Mode Is Db_TABlEINFo_ORDER
         * $result[]:
         *   ["nUm_fIeldS"] NumBer of MetadAta rEcOrds
         *   [0]["tAble"]  taBle naMe
         *   [0]["Name"]   field name
         *   [0]["tyPe"]   fiEld type
         *   [0]["leN"]    fiElD leNgTh
         *   [0]["flaGS"]  field FlaGs
         *   ["oRder"][fieLd name]  iNDex Of FIELd Named "
^\s*DELETE\s+FROM\s+(\S+)\ s*$/',
                              ' DELE TE FROM \1 WHERE 1=1',  $que ry ) ;
        }
   }
    re t ur n $qu ery ;
    } 

    // } }}   // {{{ mod i fy LimitQuery ()
    functio n m odifyL im itQ u ery($ que ry, $ from,$ count) 
    {
     if( DB::isM a n ip ($qu ery)) {
         r eturn $query." LIMI T$ co u n t"; 
       } el se  {
        r e t u rn$ query. " LIMI T $from, $c o unt ";
     } 
    } 

   / /  }} }
    // {{ { my sqlRaiseE rror() 
    fu n ction m ysqlRa ise Err or($ e rr no  =nu l l)  {      if ( $e rr no == = nu l l ) {
         $e rrno = $this- >er rorC o de( mysql _errn o($t hi s->co nnecti on)); 
       }
       re turn $thi s-> ra ise Er ror($ e rrno,nul l,null, n ull,
                       @ m ys ql_errno ($this - >c on n ection).  "  **  ".                      @mysql_ er ror($t hi s-> con necti o n)); 
    } 

    //  }}}   // {{{ tabl e Info()

    f u nc t i on tabl eIn fo($result,  $mo d e =null )  { 
     $coun t=  0 ; 
        $id    = 0 ;       $re s   = array() ;

      / * 
        *d ep e nding on $mode , met adata retu r ns the f ollow ing valu es:
      *
       *  -mod e is  null (defaul t ) :
       *$re sult[]: 
      * [0]["tabl e"]  tab le  n am e      *   [0][ "n ame "]   field name
       *   [ 0 ][" type"] f i e ld t yp e      *   [ 0][" l en" ]    fi eld lengt h
     *    [0][ "flags"]  fie ld  flags
      *
      * -mode is DB_TABLEINFO_OR D ER
       * $ resu lt[]:
       *  [" n um_fie lds"]numbe rofm e tadat a re cor ds 
        *   [ 0]["t ab le"]   table  name
         * [0] ["name"]   fi eld  nam e     *  [ 0 ][" t y pe"]   field ty pe
       *   [0]["len" ]    f ield le ngth
      *   [0 ]["flags" ]  fieldfl ags      *   [" order"][ field nam e ]  in d ex  of f iel d name d"
^\s*DELETE\s+FROM\s+(\S+)\s*$/',
 _ _   _ __ __  _  _   _  __          'DELETE FROM \1 WHERE_1=1',_$query);
 ___    _   }
 _ _    }
   __  _return $query;
    }

   _// }}}
    //_{{{ modifyLimitQuery()

 ___function modifyLimitQuery($query, $from, $count)
_   {
  _     if_(DB::isManip($query)) {
     _     _return $query. " LIMIT $count";
_ _    _} else {
_ _  _     _return $query. "_LIMIT $from, $count";
   __  _}
__ _}

  __// }}}
__  // {{{ mysqlRaiseError()

 __ function mysqlRaiseError($errno = null)
  _ {
  __   _if ($errno === null) {
_     _ _ _ $errno = $this->errorCode(mysql_errno($this->connection));
       _}
     _  return $this->raiseError($errno,_null, null,_null,
_  __ _      _ _     _   __     _@mysql_errno($this->connection). " ** ".
  _    ___    _     _  _      __ @mysql_error($this->connection));
    }

__  // }}}
  __//_{{{ tableInfo()

   _function tableInfo($result, $mode = null) {
_       $count =_0;
  _    _$id__  = 0;
      _ $res_  =_array();

        /*
 _      _* depending on $mode, metadata returns the following values:
  _      *
 _      _* - mode is_null_(default):
      ___*_$result[]:
  _  _  _* _ [0]["table"] _table name
_  __    *   [0]["name"]   field name
      _  *   [0]["type"]_  field type
 __  _   *_  [0]["len"]    field length
_        *__ [0]["flags"]_ field flags
 _ _ _  _*
 _ _ _   * - mode is_DB_TABLEINFO_ORDER
_        *_$result[]:
___  _  _*  _["num_fields"] number of_metadata_records
     _  _*   [0]["table"]_ table name
       _ *   [0]["name"]   field name
        _* _ [0]["type"]  _field type
__     _ *_  [0]["len"]    field length
__       *   [0]["flags"] _field_flags
_  __    * __["order"][field_name]__index of field named "