cvs: php4 /pear/DB ibase.php

From: Date: Thu, 07 Feb 2002 00:39:35 +0000
Subject: cvs: php4 /pear/DB ibase.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-2316@lists.php.net to get a copy of this message
cox Wed Feb 6 19:39:35 2002 EDT Modified files: /php4/pear/DB ibase.php Log: ws Index: php4/pear/DB/ibase.php diff -u php4/pear/DB/ibase.php:1.31 php4/pear/DB/ibase.php:1.32 --- php4/pear/DB/ibase.php:1.31 Sun Feb 3 04:04:15 2002 +++ php4/pear/DB/ibase.php Wed Feb 6 19:39:35 2002 @@ -16,7 +16,7 @@ // | Authors: Sterling Hughes <sterling@php.net> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.31 2002/02/03 09:04:15 mj Exp $ +// $Id: ibase.php,v 1.32 2002/02/07 00:39:35 cox Exp $ // // Database independent query interface definition for PHP's Interbase // extension. @@ -342,13 +342,13 @@ } if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'UNIQUE') { $flags .= 'unique_key '; - } + } } $sql = 'SELECT R.RDB$NULL_FLAG AS NFLAG,' .' R.RDB$DEFAULT_SOURCE AS DSOURCE,' .' F.RDB$FIELD_TYPE AS FTYPE,' - .' F.RDB$COMPUTED_SOURCE AS CSOURCE' + .' F.RDB$COMPUTED_SOURCE AS CSOURCE' .' FROM RDB$RELATION_FIELDS R ' .' JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME' .' WHERE R.RDB$RELATION_NAME=\''.$table_name.'\'' @@ -372,13 +372,13 @@ $flags .= 'blob '; } } - + return trim($flags); } - + // }}} // {{{ tableInfo() - + /** * Returns information about a table or a result set * @@ -395,7 +395,7 @@ $count = 0; $id = 0; $res = array(); - + /* * depending on $mode, metadata returns the following values: * @@ -432,10 +432,10 @@ * DB_TABLEINFO_ORDERTABLE with DB_TABLEINFO_ORDER | * DB_TABLEINFO_ORDERTABLE * or with DB_TABLEINFO_FULL */ - + // if $result is a string, then we want information about a // table without a resultset - + if (is_string($result)) { $id = ibase_query($this->connection,"SELECT * FROM $result"); if (empty($id)) { @@ -447,12 +447,12 @@ return $this->raiseError($result); } } - + $count = @ibase_num_fields($id); - + // made this IF due to performance (one if is faster than $count if's) if (empty($mode)) { - + for ($i=0; $i<$count; $i++) { $info = @ibase_field_info($id, $i); $res[$i]['table'] = (is_string($result)) ? $result : ''; @@ -461,10 +461,10 @@ $res[$i]['len'] = $info['length']; $res[$i]['flags'] = (is_string($result)) ? $this->_ibaseFieldFlags($info['name'], $result) : ''; } - + } else { // full $res["num_fields"]= $count; - + for ($i=0; $i<$count; $i++) { $info = @ibase_field_info($id, $i); $res[$i]['table'] = (is_string($result)) ? $result : ''; @@ -480,14 +480,14 @@ } } } - + // free the result only if we were called on a table if (is_resource($id)) { ibase_free_result($id); } return $res; } - + // }}} // {{{ getSpecialQuery()

« previous php.pear.cvs (#2316) next »