|
PHP 的 MySQL 操作类,跟手册上的函数一样用,但是更方便了。多说无益,看了就知道了。(4) if(!is_resource($this->Result)){ return false; } $fetchAssoc = mysql_fetch_assoc($this->Result); if($fetchAssoc && $Rows){$this->Rows++;} return $fetchAssoc; } function fetchField($fieldOffset = NULL){ /* 从结果集中取得列信息并作为对象返回 */ if(empty($fieldOffset)){ return mysql_fetch_field($this->Result, $fieldOffset); } return mysql_fetch_field($this->Result); } function fetchLengths(){ /* 取得结果集中每个输出的长度 */ return mysql_fetch_lengths($this->Result); } function fetchObject($Rows = 0){ /* 从结果集中取得一行作为对象 */ if(!is_resource($this->Result)){ return false; } $fetchObject = mysql_fetch_object($this->Result); if(is_object($fetchObject) && $Rows){$this->Rows++;} return is_object($fetchObject)?$fetchObject:false; } function fetchRow($Rows = 0){ /* 从结果集中取得一行作为枚举数组 */ if(!is_resource($this->Result)){ return false; } $fetchRow = mysql_fetch_row($this->Result); if($fetchRow && $Rows){$this->Rows++;} return $fetchRow; } function fieldFlags($fieldOffset){ /* 从结果中取得和指定字段关联的标志 */ return mysql_field_flags($this->Result, $fieldOffset); } function fieldLen($fieldOffset){ /* 返回指定字段的长度 */ return mysql_field_len($this->Result, $fieldOffset); } function fieldName($fieldIndex){ /* 取得结果中指定字段的字段名 */ return mysql_field_name($this->Result, $fieldIndex); } function fieldSeek($fieldOffset){ /* 将结果集中的指针设定为制定的字段偏移量 */ return mysql_field_seek($this->Result, $fieldOffset);
|