phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] phpgwapi/inc/class.db_msql.inc.php, 1.8


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

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

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

Log Message:
merging 16 changes
=====================================================================
Index: phpgwapi/inc/class.db_msql.inc.php
diff -u phpgwapi/inc/class.db_msql.inc.php:1.7 
phpgwapi/inc/class.db_msql.inc.php:1.8
--- phpgwapi/inc/class.db_msql.inc.php:1.7      Thu Oct  9 03:31:32 2003
+++ phpgwapi/inc/class.db_msql.inc.php  Thu May 27 04:56:26 2004
@@ -1,22 +1,24 @@
 <?php
- /**********************************************************************\
- * phpGroupWare - API - Database Abstraction                           *
- * http://www.phpgroupware.org                                         *
- * This program is part of the GNU project, see http://www.gnu.org/    *
- *                                                                     *
- * Portions Copyright 2001, 2002, 2003 Free Software Foundation, Inc.  *
- * Based on phplib - Copyright 1998-2000 SH Dienst GmbH                        
*
- *                     Boris Erdmann, Kristian Koehntopp               *
- * Contributions from Dan Kuykendall, Dave Hall and others             *
- * --------------------------------------------                                
*
- *  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 (at your option) any later version.                        
*
- \**********************************************************************/
- /* $Id$ */
-
-       class db extends db_
+       /**
+       * Database class for MSQL
+       * @author SH Dienst GmbH Boris Erdmann, Kristian Koehntopp
+    * @author Dan Kuykendall, Dave Hall and others
+       * @copyright Copyright (C) 1998-2000 SH Dienst GmbH Boris Erdmann, 
Kristian Koehntopp
+       * @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 MSQL
+       * 
+       * @package phpgwapi
+       * @subpackage database
+       */
+       class db
        {
                function connect($Database = '', $Host = '', $User = '', 
$Password = '')
                {
@@ -38,12 +40,13 @@
                                $Password = $this->Password;
                        }
 
+                       // Not connected? Then connect?
                        if (! $this->Link_ID)
                        {
                                // Check for local connect
                                $this->Link_ID = empty($Host)?
-                               $this->Link_ID=msql_pconnect():
-                               $this->Link_ID=msql_pconnect($Host);
+                                       msql_pconnect() :
+                                       msql_pconnect($Host);
                        }
 
                        // Still not connected? Raise error.
@@ -63,12 +66,12 @@
                {
                        $this->connect();
 
-                       /* printf("Debug: query = %s<br>\n", $Query_String); */
+                       #   printf("Debug: query = %s<br>\n", $Query_String);
 
                        $this->Query_ID = 
msql_query($Query_String,$this->Link_ID);
                        $this->Row   = 0;
                        $this->Error = msql_error();
-                       if(!$this->Query_ID)
+                       if (!$this->Query_ID)
                        {
                                $this->halt('Invalid SQL: '.$Query_String);
                        }
@@ -82,7 +85,7 @@
                        $this->Error = msql_error();
 
                        $stat = is_array($this->Record);
-                       if(!$stat && $this->Auto_Free)
+                       if (!$stat && $this->Auto_Free)
                        {
                                msql_free_result($this->Query_ID);
                                $this->Query_ID = 0;
@@ -93,7 +96,7 @@
                function seek($pos)
                {
                        $status = msql_data_seek($this->Query_ID, $pos);
-                       if($status)
+                       if ($status)
                        {
                                $this->Row = $pos;
                        }
@@ -108,14 +111,14 @@
 
                        $this->connect();
                        $id = @msql_list_fields($this->Database, $table);
-                       if($id < 0)
+                       if ($id < 0)
                        {
                                $this->Error = msql_error();
                                $this->halt('Metadata query failed.');
                        }
                        $count = msql_num_fields($id);
 
-                       for($i=0; $i<$count; $i++)
+                       for ($i=0; $i<$count; $i++)
                        {
                                $res[$i]['table'] = msql_fieldtable ($id, $i);
                                $res[$i]['name']  = msql_fieldname  ($id, $i);




reply via email to

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