[Phplib-commit] CVS: php-lib/php/db/mysql db_sql.inc,1.6,1.7
Brought to you by:
nhruby,
richardarcher
From: Richard A. <ric...@us...> - 2001-08-21 02:02:46
|
Update of /cvsroot/phplib/php-lib/php/db/mysql In directory usw-pr-cvs1:/tmp/cvs-serv17501/mysql Modified Files: db_sql.inc Log Message: Sync mysql/db_sql.inc with -stable tree: fix some uninitialized variable access warnings clean up some tabs, whitespace and comments delete extraneous db/db_sql.inc Index: db_sql.inc =================================================================== RCS file: /cvsroot/phplib/php-lib/php/db/mysql/db_sql.inc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** db_sql.inc 2001/08/21 01:36:54 1.6 --- db_sql.inc 2001/08/21 02:02:43 1.7 *************** *** 224,232 **** function f($Name) { ! return $this->Record[$Name]; } function p($Name) { ! print $this->Record[$Name]; } --- 224,236 ---- function f($Name) { ! if (isset($this->Record[$Name])) { ! return $this->Record[$Name]; ! } } function p($Name) { ! if (isset($this->Record[$Name])) { ! print $this->Record[$Name]; ! } } *************** *** 287,291 **** * [0]["flags"] field flags * ! * - full is true (was mainly introduced for the Query-class) * $result[]: * ["num_fields"] number of metadata records --- 291,295 ---- * [0]["flags"] field flags * ! * - full is true * $result[]: * ["num_fields"] number of metadata records *************** *** 297,302 **** * [0]["php_type"] the correspondig PHP-type * [0]["php_subtype"] the subtype of PHP-type ! * ["meta"][field name] index-num of field named "field name" ! * This could used, if you have the name, but no index-num - very fast * [unique] = field names which have an unique key, separated by space */ --- 301,307 ---- * [0]["php_type"] the correspondig PHP-type * [0]["php_subtype"] the subtype of PHP-type ! * ["meta"][field name] index of field named "field name" ! * This last one could be used if you have a field name, but no index. ! * Test: if (isset($result['meta']['myfield'])) { ... * [unique] = field names which have an unique key, separated by space */ *************** *** 331,335 **** } } else { // full ! $uniq=ARRAY(); $res["num_fields"]= $count; --- 336,340 ---- } } else { // full ! $uniq=array(); $res["num_fields"]= $count; *************** *** 368,375 **** $res[$i]["php_subtype"]=""; break; ! } ! if ( ereg("(unique_key|primary_key)",$res[$i]["flags"]) ) { $uniq[]=$res[$i]["name"]; ! } } $res["unique"]=join(" ",$uniq); --- 373,380 ---- $res[$i]["php_subtype"]=""; break; ! } ! if ( ereg("(unique_key|primary_key)",$res[$i]["flags"]) ) { $uniq[]=$res[$i]["name"]; ! } } $res["unique"]=join(" ",$uniq); *************** *** 377,382 **** // free the result only if we were called on a table ! if ($table) @mysql_free_result($id); return $res; } --- 382,388 ---- // free the result only if we were called on a table ! if ($table) { @mysql_free_result($id); + } return $res; } *************** *** 388,394 **** $i = 0; while ($info = @mysql_fetch_row($this->Query_ID)) { ! $return[$i]["table_name"]= $info[0]; ! $return[$i]["tablespace_name"]=$this->Database; ! $return[$i]["database"]=$this->Database; $i++; } --- 394,400 ---- $i = 0; while ($info = @mysql_fetch_row($this->Query_ID)) { ! $return[$i]["table_name"] = $info[0]; ! $return[$i]["tablespace_name"] = $this->Database; ! $return[$i]["database"] = $this->Database; $i++; } *************** *** 420,422 **** } ?> - --- 426,427 ---- |