ray[] = $row;
}
//释放资源
mysql_free_result($result);
//返回结果
return $array;
}
/**
* 显示错误信息,根据参数判断是否在错误信息中显示出错的SQL语句
*/
function getError($showSQL = false) {
return "错误代码:{$this->_errno}<br /><font color=\"red\">错误信息:{$this->_error}</font>".($showSQL?"<br />出错的SQL语句:<pre>$this->_sql</pre>":'');
}
/**
* 返回最后一次使用INSERT语句产生的ID值
*/
function lastid()
{
return mysql_insert_id();
}
/**
* 取得mysql的版本信息
*
* @return string
*/
function getVersion()
{
return mysql_get_server_info();
}
/**
* 取得创建表的SQL语句
*/
function getTableCreateSQL( $table ) {
$this->setSql('SHOW CREATE table '.$table);
$this->query();
$result = $this->loadRowList(2);
return $result;
}
/**
* 取得表的字段
列表 */
function getTableFields($table) {
$this->setSql( 'SHOW FIELDS FROM ' . $table );
$this->query();
$fields = $this->loadRowList(2);
return $fields;
}
}
?>