phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] phpgwapi/inc/class.db_mssql.inc.php, 1.25


From: nomail
Subject: [Phpgroupware-cvs] phpgwapi/inc/class.db_mssql.inc.php, 1.25
Date: Thu, 27 May 2004 06:56:27 +0200

Update of /phpgwapi/inc
Modified Files:
        Branch: 
          class.db_mssql.inc.php

date: 2004/05/27 04:56:27;  author: skwashd;  state: Exp;  lines: +31 -27

Log Message:
merging 16 changes
=====================================================================
Index: phpgwapi/inc/class.db_mssql.inc.php
diff -u phpgwapi/inc/class.db_mssql.inc.php:1.24 
phpgwapi/inc/class.db_mssql.inc.php:1.25
--- phpgwapi/inc/class.db_mssql.inc.php:1.24    Thu Oct  9 03:31:32 2003
+++ phpgwapi/inc/class.db_mssql.inc.php Thu May 27 04:56:27 2004
@@ -1,20 +1,24 @@
 <?php
-  /**************************************************************************\
-  * phpGroupWare API - MS SQL Server support                                 *
-  * (C) Copyright 1998 Cameron Taggart (address@hidden)               *
-  * Contributiors Guarneri Carmelo, Cameron Just, Dave Hall, Signude Ness    *
-  * ------------------------------------------------------------------------ *
-  * This is not part of phpGroupWare, but is used by phpGroupWare.           * 
-  * http://www.phpgroupware.org/                                             * 
-  * ------------------------------------------------------------------------ *
-  * This program is free software; you can redistribute it and/or modify it  *
-  * under the terms of the GNU Lesser General Public License as published    *
-  * by the Free Software Foundation; either version 2.1 of the License, or   *
-  * any later version.                                                       *
-  \**************************************************************************/
-  /* $Id$ */
-
-       class db extends db_
+       /**
+       * Database class for MS SQL
+       * @author Cameron Taggart &lt;address@hidden
+    * @author Dan Kuykendall, Dave Hall and others
+       * @copyright Copyright (C) 1998 Cameron Taggart
+       * @copyright Portions Copyright (C) 2001-2004 Free Software Foundation, 
Inc. http://www.fsf.org/
+       * @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General 
Public License
+       * @link http://www.sanisoft.com/phplib/manual/DB_sql.php
+       * @package phpgwapi
+       * @subpackage database
+       * @version $Id$
+       */
+
+       /**
+       * Database class for MS SQL
+       * 
+       * @package phpgwapi
+       * @subpackage database
+       */
+       class db
        {
                var $VEOF         = -1;
                var $Transaction  = false;
@@ -218,21 +222,21 @@
                        $res   = array();
 
                        $this->connect();
-                       $id = mssql_query("select * from $table", 
$this->Link_ID);
+                       $id = mssql_query("exec sp_columns $table", 
$this->Link_ID);
                        if (!$id)
                        {
                                $this->halt('Metadata query failed.');
                        }
 
-                       $count = mssql_num_fields($id);
+                       $count = mssql_num_rows($id);
 
                        for ($i=0; $i<$count; $i++)
                        {
-                               $info = mssql_fetch_field($id, $i);
                                $res[$i]['table'] = $table;
-                               $res[$i]['name']  = $info['name'];
-                               $res[$i]['len']   = $info['max_length'];
-                               $res[$i]['flags'] = $info['numeric'];
+                               $res[$i]['name']  = mssql_result($id, $i, 
'COLUMN_NAME');
+                               $res[$i]['type']  = mssql_result($id, $i, 
'TYPE_NAME');
+                               $res[$i]['len']   = mssql_result($id, $i, 
'LENGTH');
+                               $res[$i]['flags'] = mssql_result($id, $i, 
'REMARKS');
                        }
                        $this->free_result();
                        return $res;
@@ -261,9 +265,9 @@
                        return mssql_num_fields($this->Query_ID);
                }
 
-               function f($Field_Name, $strip_slashes)
-               {       
-                       if ($strip_slashes || ($this->auto_stripslashes && ! 
$strip_slashes))
+               function f($Field_Name)
+               {
+               if ($strip_slashes || ($this->auto_stripslashes && ! 
$strip_slashes))
                        {
                                return str_replace("''", "'", 
$this->Record[$Name]);
                        }
@@ -277,7 +281,7 @@
                {
                        if (!isset($table) || $table == '' || !isset($field) || 
$field == '')
                        {
-                               return -1;
+                       return -1;
                        }
 
                        $result = @mssql_query("select @@identity", 
$this->Link_ID);
@@ -331,7 +335,7 @@
                        {
                                echo "<p><b>Session halted.</b>";
                                $this->transaction_abort();
-                               exit;
+                               $GLOBALS['phpgw']->common->phpgw_exit(True);
                        }
                }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]