[cvs] commit: horde/lib/SessionHandler sapdb.php sql.php

Mike Cochrane mike@graftonhall.co.nz
Sun, 8 Sep 2002 20:02:01 -0700 (PDT)


mikec       2002/09/08 20:02:00 PDT

  Modified files:
    lib/SessionHandler   sapdb.php sql.php 
  Log:
  User the PEAR DB prepare and execute functions for the Update and Insert statements to allow for some drivers not handling updating of LONG data types. Tested on mysql and sapdb.
  
  Simplify sapdb driver as this is now handled by the sql driver. As the PEAR ODBC driver doesn't implement the prepare and execute functions nativly you may need to add the folowing functions to your pear/db/odbc.php file:
  
      // }}}
      // {{{ prepare()
  
      function prepare($query)
      {
          return odbc_prepare($this->connection, $query);
      }
  
      // }}}
      // {{{ execute()
  
      function execute($stmt, $data = false)
      {
          $result = @odbc_execute($stmt, $data);
          if (!$result) {
              return $this->odbcRaiseError(); // XXX ERRORMSG
          }
          // Determine which queries that should return data, and which
          // should return an error code only.
          if (DB::isManip($query)) {
              return DB_OK;
          }
          $this->row[$result] = 0;
          return $result;
      }
      // }}}
  
  Revision  Changes    Path
  1.4       +2 -46     horde/lib/SessionHandler/sapdb.php
  1.3       +17 -20    horde/lib/SessionHandler/sql.php

  Chora Links:
  http://cvs.horde.org/diff.php/horde/lib/SessionHandler/sapdb.php?r1=1.3&r2=1.4&ty=u
  http://cvs.horde.org/diff.php/horde/lib/SessionHandler/sql.php?r1=1.2&r2=1.3&ty=u