[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc/class.db_sybase.inc.php, 1.9
From: |
nomail |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc/class.db_sybase.inc.php, 1.9 |
Date: |
Thu, 27 May 2004 06:56:28 +0200 |
Update of /phpgwapi/inc
Modified Files:
Branch:
class.db_sybase.inc.php
date: 2004/05/27 04:56:28; author: skwashd; state: Exp; lines: +32 -27
Log Message:
merging 16 changes
=====================================================================
Index: phpgwapi/inc/class.db_sybase.inc.php
diff -u phpgwapi/inc/class.db_sybase.inc.php:1.8
phpgwapi/inc/class.db_sybase.inc.php:1.9
--- phpgwapi/inc/class.db_sybase.inc.php:1.8 Thu Oct 9 03:31:32 2003
+++ phpgwapi/inc/class.db_sybase.inc.php Thu May 27 04:56:28 2004
@@ -1,23 +1,26 @@
<?php
- /**************************************************************************\
- * phpGroupWare API - Sybase DB support *
- * Copyright (c) 1998,1999 SH Online Dienst GmbH Boris Erdmann, *
- * Kristian Koehntopp *
- * Adapted from db_mysql.inc by Sascha Schumann <address@hidden> *
- * metadata() contributed by Adelino Monteiro <address@hidden> *
- * ------------------------------------------------------------------------ *
- * 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 Sybase
+ * @author NetUSE AG Boris Erdmann, Kristian Koehntopp
+ * @author Sascha Schumann <address@hidden>, Adelino Monteiro
<address@hidden>
+ * @copyright Copyright (C) 1998-1999 SH Online Dienst GmbH Boris
Erdmann, Kristian Koehntopp
+ * @copyright Portions Copyright (C) 2003,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 Sybase
+ *
+ * @package phpgwapi
+ * @subpackage database
+ */
+ class db
{
+
function connect($Database = '', $Host = '', $User = '',
$Password = '')
{
/* Handle defaults */
@@ -37,9 +40,10 @@
{
$Password = $this->Password;
}
+
if (! $this->Link_ID)
{
-
if($GLOBALS['phpgw_info']['server']['db_persistent'])
+ if
($GLOBALS['phpgw_info']['server']['db_persistent'])
{
$this->Link_ID=sybase_pconnect($Host,$User,$Password);
}
@@ -48,9 +52,9 @@
$this->Link_ID=sybase_connect($Host,$User,$Password);
}
}
- if(!$this->Link_ID)
+ if (!$this->Link_ID)
{
- $this->halt('Link-ID == false,
'.($GLOBALS['phpgw_info']['server']['db_persistent']?'p':'')..'connect failed');
+ $this->halt('Link-ID == false,
'.($GLOBALS['phpgw_info']['server']['db_persistent']?'p':'').'connect failed');
}
if(!sybase_select_db($Database, $this->Link_ID))
{
@@ -71,11 +75,11 @@
{
$this->connect();
- /* printf("Debug: query = %s<br>\n", $Query_String); */
+ # printf("Debug: query = %s<br>\n", $Query_String);
$this->Query_ID =
sybase_query($Query_String,$this->Link_ID);
$this->Row = 0;
- if(!$this->Query_ID)
+ if (!$this->Query_ID)
{
$this->halt('Invalid SQL: '.$Query_String);
}
@@ -89,7 +93,7 @@
$this->Row += 1;
$stat = is_array($this->Record);
- if(!$stat && $this->Auto_Free)
+ if (!$stat && $this->Auto_Free)
{
sybase_free_result($this->Query_ID);
$this->Query_ID = 0;
@@ -100,7 +104,7 @@
function seek($pos)
{
$status = sybase_data_seek($this->Query_ID, $pos);
- if($status)
+ if ($status)
{
$this->Row = $pos;
}
@@ -115,7 +119,7 @@
$this->connect();
$result = $this->query("exec sp_columns $table");
- if($result < 0)
+ if ($result < 0)
{
$this->Errno = 1;
$this->Error = 'Metadata query failed';
@@ -123,7 +127,7 @@
}
$count = sybase_num_rows($result);
- for($i=0; $i<$count; $i++)
+ for ($i=0; $i<$count; $i++)
{
$res[$i]['table'] = $table ;
$res[$i]['name'] = sybase_result ($result, $i,
'COLUMN_NAME');
@@ -131,6 +135,7 @@
$res[$i]['len'] = sybase_result ($result, $i,
'LENGTH');
$res[$i]['position'] = sybase_result ($result,
$i, 'ORDINAL_POSITION');
$res[$i]['flags'] = sybase_result ($result, $i,
'REMARKS');
+
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] phpgwapi/inc/class.db_sybase.inc.php, 1.9,
nomail <=