<?php
session_start();
$tgurl="";
if(empty($tgurl)) $url_this = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"];
else $url_this =$tgurl;
$conn = @mysql_connect("$db_host","$db_username","$db_password") or die ("数据库连接出错，请联系管理员 。");
@mysql_select_db("$accountdb",$conn) or die ("数据库表不存在或者未连接。请联系管理员 。");
mysql_query("set names UTF8"); //使用文件编码，防止出错

date_default_timezone_set('Asia/Shanghai');

function dbin($db,$table,$type) {
$dbin=mysql_query("INSERT INTO `$db`.`$table` $type");
return $dbin;
}

function dbst($db,$table,$type) {
$dbselect=mysql_query("SELECT * FROM `$db`.`$table` where $type");
$rowdbselect=mysql_fetch_array($dbselect);
return $rowdbselect;
}

function dbqy($db,$table,$type) {
$dbq=mysql_query("SELECT * FROM `$db`.`$table` $type");
while($rdb=mysql_fetch_array($dbq)){
$rdbq[]=$rdb;
}
return $rdbq;
}

function dbct($db,$table,$type) {
$dbqsun=mysql_query("SELECT count(id) FROM `$db`.`$table` $type");
$rdbsun=mysql_fetch_array($dbqsun);
return $rdbsun;
}

function dbdel($db,$table,$type) {
$dbdel=mysql_query("delete FROM `$db`.`$table` where $type");
return $rdel;
}


function dbup($db,$table,$type) {
$dbup=mysql_query("UPDATE `$db`.`$table` SET $type");
return $dbup;
}

//写日志文件


?>