mysql操作类(9)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:15 点击:次
$this->query("select * from $table_name");
echo "<br>";
echo "字段数:".$total=mysql_num_fields($this->result);
for ($i=0;$i<$total;$i++){
print_r(mysql_fetch_field($this->result,$i));
}
echo "</pre>";
echo "<br>";
}
//取得mysql 服务器信息
public function mysql_server($num=''){
switch ($num){
case 1:
return mysql_get_server_info();
break;
case 2:
return mysql_get_host_info();
break;
case 3:
return mysql_get_client_info();
break;
case 4:
return mysql_get_proto_info();
break;
default:
return mysql_get_client_info();
}
}
public function __destruct(){
if(!emptyempty($this->result)){
$this->free();
}
mysql_close($this->conn);
}
//获得客户端真实的ID地址
function getip() {
if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) {
$ip = getenv("HTTP_CLIENT_IP");
} else
if (getenv("HTTP_X_FORWARDED_FOR") &&strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) {
相关新闻>>
- 发表评论
-
- 最新评论 更多>>