本文整理汇总了PHP中DoSetDbChar函数的典型用法代码示例。如果您正苦于以下问题:PHP DoSetDbChar函数的具体用法?PHP DoSetDbChar怎么用?PHP DoSetDbChar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoSetDbChar函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: db_connect
function db_connect()
{
global $phome_db_server, $phome_db_username, $phome_db_password, $phome_db_dbname, $phome_db_port, $phome_db_char, $phome_db_ver, $editor, $fun_r;
$dblocalhost = $phome_db_server;
//端口
if ($phome_db_port) {
$dblocalhost .= ":" . $phome_db_port;
}
$link = @mysql_connect($dblocalhost, $phome_db_username, $phome_db_password);
//mysql_select_db($phome_db_dbname);
if (empty($link)) {
if (empty($fun_r['ConntConnectDb'])) {
if ($editor == 1) {
$a = "../";
} elseif ($editor == 2) {
$a = "../../";
} elseif ($editor == 3) {
$a = "../../../";
} else {
$a = "";
}
@(include_once $a . LoadLang('f.php'));
}
echo $fun_r['ConntConnectDb'];
exit;
}
//编码
DoSetDbChar($phome_db_char);
if ($phome_db_ver >= '5.0') {
@mysql_query("SET sql_mode=''");
}
return $link;
}
示例2: DoSetDbChar
<?php
require "../../inc/header.php";
/*
SoftName : EmpireBak Version 2010
Author : wm_chief
Copyright: Powered by www.phome.net
*/
DoSetDbChar('utf8');
E_D("DROP TABLE IF EXISTS `tp_update_record`;");
E_C("CREATE TABLE `tp_update_record` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `msg` varchar(600) NOT NULL DEFAULT '',\n `type` varchar(20) NOT NULL DEFAULT '',\n `time` int(10) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`)\n) ENGINE=MyISAM AUTO_INCREMENT=20 DEFAULT CHARSET=utf8");
require "../../inc/footer.php";
示例3: DoSetDbChar
<?php
require "../../inc/header.php";
/*
SoftName : EmpireBak Version 2010
Author : wm_chief
Copyright: Powered by www.phome.net
*/
DoSetDbChar('gbk');
E_D("DROP TABLE IF EXISTS `fanwe_region_conf`;");
E_C("CREATE TABLE `fanwe_region_conf` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `pid` int(11) NOT NULL,\n `name` varchar(50) NOT NULL COMMENT '????????',\n `region_level` tinyint(4) NOT NULL COMMENT '1:?? 2:? 3:??(??) 4:??(??)',\n `py` varchar(50) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=MyISAM AUTO_INCREMENT=3401 DEFAULT CHARSET=gbk");
E_D("replace into `fanwe_region_conf` values('3','1','安徽','2','anhui');");
E_D("replace into `fanwe_region_conf` values('4','1','福建','2','fujian');");
E_D("replace into `fanwe_region_conf` values('5','1','甘肃','2','gansu');");
E_D("replace into `fanwe_region_conf` values('6','1','广东','2','guangdong');");
E_D("replace into `fanwe_region_conf` values('7','1','广西','2','guangxi');");
E_D("replace into `fanwe_region_conf` values('8','1','贵州','2','guizhou');");
E_D("replace into `fanwe_region_conf` values('9','1','海南','2','hainan');");
E_D("replace into `fanwe_region_conf` values('10','1','河北','2','hebei');");
E_D("replace into `fanwe_region_conf` values('11','1','河南','2','henan');");
E_D("replace into `fanwe_region_conf` values('12','1','黑龙江','2','heilongjiang');");
E_D("replace into `fanwe_region_conf` values('13','1','湖北','2','hubei');");
E_D("replace into `fanwe_region_conf` values('14','1','湖南','2','hunan');");
E_D("replace into `fanwe_region_conf` values('15','1','吉林','2','jilin');");
E_D("replace into `fanwe_region_conf` values('16','1','江苏','2','jiangsu');");
E_D("replace into `fanwe_region_conf` values('17','1','江西','2','jiangxi');");
E_D("replace into `fanwe_region_conf` values('18','1','辽宁','2','liaoning');");
E_D("replace into `fanwe_region_conf` values('19','1','内蒙古','2','neimenggu');");
E_D("replace into `fanwe_region_conf` values('20','1','宁夏','2','ningxia');");
E_D("replace into `fanwe_region_conf` values('21','1','青海','2','qinghai');");
E_D("replace into `fanwe_region_conf` values('22','1','山东','2','shandong');");
示例4: Ebak_DoTranExecSql
function Ebak_DoTranExecSql($file, $file_name, $file_type, $file_size, $add)
{
global $empire, $phome_db_dbname, $phome_db_ver, $phome_db_char;
if (!$file_name || !$file_size) {
printerror("NotChangeSQLFile", "history.go(-1)");
}
$filetype = GetFiletype($file_name);
//取得扩展名
if ($filetype != ".sql") {
printerror("NotTranSQLFile", "history.go(-1)");
}
//上传文件
$newfile = 'tmp/uploadsql' . time() . '.sql';
$cp = Ebak_DoTranFile($file, $newfile);
if (empty($cp)) {
printerror("TranSQLFileFail", "history.go(-1)");
}
$query = ReadFiletext($newfile);
DelFiletext($newfile);
if (!$query) {
printerror("EmptyRunSql", "history.go(-1)");
}
//数据库
if ($add['mydbname']) {
$empire->query("use `" . $add['mydbname'] . "`");
}
//编码
if ($add['mydbchar']) {
DoSetDbChar($add['mydbchar']);
}
Ebak_DoRunQuery($query, $add['mydbchar'], $phome_db_ver);
printerror("RunSqlSuccess", "DoSql.php");
}
示例5: Ebak_BakExeT
function Ebak_BakExeT($t,$s,$p,$mypath,$alltotal,$thenof,$fnum,$auf='',$aufval=0,$stime=0){
global $empire,$bakpath,$limittype,$fun_r;
if(empty($mypath))
{
printerror("ErrorUrl","history.go(-1)");
}
$path=$bakpath."/".$mypath;
@include($path."/config.php");
if(empty($b_table))
{
printerror("ErrorUrl","history.go(-1)");
}
$waitbaktime=(int)$_GET['waitbaktime'];
if(empty($stime))
{
$stime=time();
}
$header="<?php
require(\"../../inc/header.php\");
";
$footer="
require(\"../../inc/footer.php\");
?>";
$btb=explode(",",$b_table);
$count=count($btb);
$t=(int)$t;
$s=(int)$s;
$p=(int)$p;
//备份完毕
if($t>=$count)
{
echo"<script>alert('".$fun_r['BakSuccess']."\\n\\n".$fun_r['TotalUseTime'].ToChangeUseTime($stime)."');self.location.href='ChangeDb.php';</script>";
exit();
}
$dumpsql=Ebak_ReturnVer();
//选择数据库
$u=$empire->query("use `$b_dbname`");
//编码
if($b_dbchar=='auto')
{
if(empty($s))
{
$status_r=Ebak_GetTotal($b_dbname,$btb[$t]);
$collation=Ebak_GetSetChar($status_r['Collation']);
DoSetDbChar($collation);
//总记录数
$num=$limittype?-1:$status_r['Rows'];
}
else
{
$collation=$_GET['collation'];
DoSetDbChar($collation);
$num=(int)$alltotal;
}
$dumpsql.=Ebak_ReturnSetNames($collation);
}
else
{
DoSetDbChar($b_dbchar);
if(empty($s))
{
//总记录数
if($limittype)
{
$num=-1;
}
else
{
$status_r=Ebak_GetTotal($b_dbname,$btb[$t]);
$num=$status_r['Rows'];
}
}
else
{
$num=(int)$alltotal;
}
}
//备份数据库结构
if($b_stru&&empty($s))
{
$dumpsql.=Ebak_Returnstru($btb[$t],$b_strufour);
}
//取得字段数
if(empty($fnum))
{
$return_fr=Ebak_ReturnTbfield($b_dbname,$btb[$t],$b_autofield);
$fieldnum=$return_fr['num'];
$noautof=$return_fr['autof'];
$auf=$return_fr['auf'];
}
else
{
$fieldnum=$fnum;
$noautof=$thenof;
}
//自动识别自增项
$aufval=(int)$aufval;
if($b_autoauf==1&&$auf)
{
$sql=$empire->query("select * from `".$btb[$t]."` where ".$auf.">".$aufval." order by ".$auf." limit $b_bakline");
//.........这里部分代码省略.........
示例6: substr
<?php
require substr(dirname(__FILE__), 0, -3) . 'class/connect.php';
if (!defined('InEmpireBak')) {
exit;
}
@(require 'config.php');
require EBAK_PATH . 'class/db_sql.php';
require EBAK_PATH . 'class/functions.php';
require EBAK_PATH . LoadLang('f.php');
$editor = 2;
$lur = islogin();
$loginin = $lur['username'];
$rnd = $lur['rnd'];
$link = db_connect();
$empire = new mysqlquery();
$mydbname = RepPostVar($_GET['mydbname']);
$mypath = $_GET['mypath'];
if (empty($mydbname) || empty($mypath)) {
printerror("ErrorUrl", "history.go(-1)");
}
DoSetDbChar($b_dbchar);
$usql = $empire->query("use `{$mydbname}`");
示例7: Ebak_BakExeT
function Ebak_BakExeT($t, $s, $p, $mypath, $alltotal, $thenof, $fnum, $auf = '', $aufval = 0, $stime = 0)
{
global $empire, $bakpath, $limittype, $fun_r;
if (empty($mypath)) {
printerror('ErrorUrl', 'history.go(-1)');
}
$path = $bakpath . '/' . $mypath;
@(include $path . '/config.php');
if (empty($b_table)) {
printerror('ErrorUrl', 'history.go(-1)');
}
$waitbaktime = (int) $_GET['waitbaktime'];
if (empty($stime)) {
$stime = time();
}
$header = "<?php\nrequire(\"../../inc/header.php\");\n";
$footer = "\nrequire(\"../../inc/footer.php\");\n?>";
$btb = explode(',', $b_table);
$count = count($btb);
$t = (int) $t;
$s = (int) $s;
$p = (int) $p;
if ($t >= $count) {
echo "<script>alert('" . $fun_r['BakSuccess'] . "\\n\\n" . $fun_r['TotalUseTime'] . ToChangeUseTime($stime) . "');self.location.href='ChangeDb.php';</script>";
exit;
}
$dumpsql = Ebak_ReturnVer();
$u = $empire->query("use `{$b_dbname}`");
if ($b_dbchar == 'auto') {
if (empty($s)) {
$status_r = Ebak_GetTotal($b_dbname, $btb[$t]);
$collation = Ebak_GetSetChar($status_r['Collation']);
DoSetDbChar($collation);
$num = $limittype ? -1 : $status_r['Rows'];
} else {
$collation = $_GET['collation'];
DoSetDbChar($collation);
$num = (int) $alltotal;
}
$dumpsql .= Ebak_ReturnSetNames($collation);
} else {
DoSetDbChar($b_dbchar);
if (empty($s)) {
if ($limittype) {
$num = -1;
} else {
$status_r = Ebak_GetTotal($b_dbname, $btb[$t]);
$num = $status_r['Rows'];
}
} else {
$num = (int) $alltotal;
}
}
if ($b_stru && empty($s)) {
$dumpsql .= Ebak_Returnstru($btb[$t], $b_strufour);
}
if (empty($fnum)) {
$return_fr = Ebak_ReturnTbfield($b_dbname, $btb[$t], $b_autofield);
$fieldnum = $return_fr['num'];
$noautof = $return_fr['autof'];
$auf = $return_fr['auf'];
} else {
$fieldnum = $fnum;
$noautof = $thenof;
}
$aufval = (int) $aufval;
if ($b_autoauf == 1 && $auf) {
$sql = $empire->query('select * from `' . $btb[$t] . '` where ' . $auf . '>' . $aufval . ' order by ' . $auf . " limit {$b_bakline}");
} else {
$sql = $empire->query('select * from `' . $btb[$t] . "` limit {$s},{$b_bakline}");
}
$inf = '';
if ($b_beover == 1) {
$inf = '(' . Ebak_ReturnInTbfield($b_dbname, $btb[$t]) . ')';
}
$hexf = '';
if ($b_bakdatatype == 1) {
$hexf = Ebak_ReturnInStrTbfield($b_dbname, $btb[$t]);
}
$b = 0;
while ($r = $empire->fetch($sql)) {
if ($auf) {
$lastaufval = $r[$auf];
}
$b = 1;
$s++;
$dumpsql .= "E_D(\"" . $b_insertf . ' into `' . $btb[$t] . '`' . $inf . ' values(';
$first = 1;
for ($i = 0; $i < $fieldnum; $i++) {
if (empty($first)) {
$dumpsql .= ',';
} else {
$first = 0;
}
$myi = $i + 1;
if (!isset($r[$i]) || strstr($noautof, ',' . $myi . ',')) {
$dumpsql .= 'NULL';
} else {
$dumpsql .= Ebak_ReSqlFtext($r[$i], $b_bakdatatype, $myi, $hexf);
}
//.........这里部分代码省略.........
示例8: backup
public function backup()
{
$t = $_GET['t'];
$s = $_GET['e'];
$p = $_GET['p'];
$savepath = $_REQUEST['savepath'] ? $_REQUEST['savepath'] : date("YmdHis", time());
$alltotal = $_GET['alltotal'];
$thenof = $_GET['thenof'];
$fnum = $_GET['fnum'];
$stime = $_GET['stime'];
$bakpath = C("DB_BAKPATH");
$b_table = $_SESSION['b_table'];
//要备份的表checkbox$_POST['checkbox'];
if ($_REQUEST['baktable']) {
$_SESSION['b_table'] = $_REQUEST['baktable'];
//备份信息
$b_table = $_REQUEST['baktable'];
//要备份的表checkbox$_POST['checkbox'];
}
if ($_REQUEST['info']) {
$_SESSION['bak_info'] = $_REQUEST['info'];
}
//备份信息
Mheader("utf-8");
if (empty($savepath)) {
$this->error("必须指定备份数据库保存目录");
}
$path = $bakpath . "/" . $savepath;
if (empty($b_table)) {
$this->error("要备份的数据表不能为空");
}
$waitbaktime = $this->waitbaktime;
if (empty($stime)) {
$stime = time();
}
$btb = explode(",", $b_table);
$count = count($btb);
$t = (int) $t;
$s = (int) $s;
$p = (int) $p;
//备份完毕
$btb[$t] = str_replace(";", "", $btb[$t]);
if ($t >= $count) {
MakeFile($_SESSION['bak_info'], $path . "/info.txt");
//保存备注信息
unset($_SESSION['b_table'], $_SESSION['bak_info']);
echo "<script>alert('备份完成\\n\\n共用时" . UseTime($stime) . "');self.location.href='" . __URL__ . "';</script>";
exit;
}
$cpright = Cpright();
//版权信息
//编码
$b_dbchar = "utf-8";
//默认使用utf-8
if ($b_dbchar == 'auto') {
if (empty($s)) {
$status_r = Ebak_GetTotal($b_dbname, $btb[$t]);
$collation = Ebak_GetSetChar($status_r['Collation']);
DoSetDbChar($collation);
//总记录数
$num = $limittype ? -1 : $status_r['Rows'];
} else {
$collation = $_GET['collation'];
DoSetDbChar($collation);
$num = (int) $alltotal;
}
$dumpsql .= Ebak_ReturnSetNames($collation);
} else {
if (empty($s)) {
//总记录数
if ($limittype) {
$num = -1;
} else {
$status_r = M()->query("SHOW TABLE STATUS LIKE '" . $btb[$t] . "';");
//当前表的总记录数
$num = $status_r[0]['Rows'];
}
} else {
$num = (int) $alltotal;
}
}
//备份数据库结构
if (empty($s)) {
$dumpsql .= DB_t_stru($btb[$t]);
}
//取得字段数
if (empty($fnum)) {
$return_fr = GetTbField($btb[$t]);
$fieldnum = $return_fr['num'];
//字段数
$noautof = $return_fr['autof'];
} else {
$fieldnum = $fnum;
$noautof = $thenof;
}
//完整插入
$inf = '';
if ($b_beover == 1) {
$inf = '(' . GetInsertSql($btb[$t]) . ')';
//插入语句的字段
//.........这里部分代码省略.........
示例9: DoSetDbChar
<?php
require "../../inc/header.php";
/*
SoftName : EmpireBak Version 2010
Author : wm_chief
Copyright: Powered by www.phome.net
*/
DoSetDbChar('utf8mb4');
E_D("DROP TABLE IF EXISTS `ecs_touch_priv`;");
E_C("CREATE TABLE `ecs_touch_priv` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `user_id` int(11) NOT NULL,\n `action_list` text NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8");
E_D("replace into `ecs_touch_priv` values('3','2','goods_manage,cat_manage,cat_drop,attr_manage,brand_manage,goods_type,comment_manage,users_manage,users_drop,user_rank,surplus_manage,account_manage,admin_manage,admin_drop,allot_priv,logs_manage,logs_drop,template_manage,agency_manage,suppliers_manage,role_manage,shop_config,ship_manage,payment,shiparea_manage,area_manage,friendlink,db_backup,db_renew,flash_manage,navigator,cron,sitemap,file_priv,file_check,reg_fields,shop_authorized,webcollect_manage,website,user_card,mail_settings,category_icon,ectouch,weixintong,order_os_edit,order_ps_edit,order_ss_edit,order_edit,order_view,order_view_finished,repay_manage,booking,sale_order_stats,client_flow_stats,delivery_view,back_view,topic_manage,snatch_manage,bonus_manage,gift_manage,card_manage,pack,ad_manage,auction,group_by,favourable,whole_sale,package_manage,exchange_goods,template_select,template_setup,library_manage,lang_edit,backup_setting,mail_template,db_backup,db_renew,db_optimize,sql_query,convert,wx_api,wx_menu,wx_config,wx_bonus,wx_regmsg,wx_lang,wx_keywords,wx_point,wx_fun,wx_prize,wx_zjd,wx_dzp,wx_qr,wx_order,wx_pay,wx_reorder,wx_fans,wx_oauth,wx_tuijian,wx_list,wx_autoreg,affiliate,affiliate_ck,zdy_parent,danpin_tuiguang');");
E_D("replace into `ecs_touch_priv` values('4','3','goods_manage,cat_manage,attr_manage,wx_api,wx_menu,wx_config,wx_bonus,wx_regmsg,wx_lang,wx_keywords,wx_point,wx_fun,wx_prize,wx_zjd,wx_dzp,wx_qr,wx_order,wx_pay,wx_reorder,wx_fans,wx_oauth,wx_tuijian,wx_list');");
E_D("replace into `ecs_touch_priv` values('5','4','goods_manage,cat_manage,cat_drop,attr_manage,brand_manage,goods_type,users_manage,users_drop,user_rank,surplus_manage,account_manage,admin_manage,admin_drop,allot_priv,logs_manage,logs_drop,template_manage,agency_manage,suppliers_manage,role_manage,shop_config,ship_manage,payment,shiparea_manage,area_manage,friendlink,db_backup,db_renew,flash_manage,navigator,cron,sitemap,file_priv,file_check,reg_fields,shop_authorized,webcollect_manage,website,user_card,mail_settings,category_icon,ectouch,weixintong,order_os_edit,order_ps_edit,order_ss_edit,order_edit,order_view,order_view_finished,repay_manage,booking,sale_order_stats,client_flow_stats,delivery_view,back_view,topic_manage,snatch_manage,bonus_manage,gift_manage,card_manage,pack,ad_manage,auction,group_by,favourable,whole_sale,package_manage,exchange_goods,template_select,template_setup,library_manage,lang_edit,backup_setting,mail_template,db_backup,db_renew,db_optimize,sql_query,convert,wx_api,wx_menu,wx_config,wx_bonus,wx_regmsg,wx_lang,wx_keywords,wx_point,wx_fun,wx_prize,wx_zjd,wx_dzp,wx_qr,wx_order,wx_pay,wx_reorder,wx_fans,wx_oauth,wx_tuijian,wx_list,wx_autoreg,affiliate,affiliate_ck,danpin_tuiguang');");
E_D("replace into `ecs_touch_priv` values('6','6','db_backup,db_renew,db_backup,db_renew,db_optimize,sql_query,convert,wx_api,wx_menu,wx_config,wx_bonus,wx_regmsg,wx_lang,wx_keywords,wx_point,wx_fun,wx_prize,wx_zjd,wx_dzp,wx_qr,wx_order,wx_pay,wx_reorder,wx_fans,wx_oauth,wx_tuijian,wx_list,wx_autoreg,affiliate,affiliate_ck,zdy_parent,danpin_tuiguang');");
E_D("replace into `ecs_touch_priv` values('7','1','goods_manage,cat_manage,cat_drop,attr_manage,brand_manage,goods_type,comment_manage,users_manage,users_drop,user_rank,surplus_manage,account_manage,admin_manage,admin_drop,allot_priv,logs_manage,logs_drop,template_manage,agency_manage,suppliers_manage,role_manage,shop_config,ship_manage,payment,shiparea_manage,area_manage,friendlink,db_backup,db_renew,flash_manage,navigator,cron,sitemap,file_priv,file_check,reg_fields,shop_authorized,webcollect_manage,website,user_card,mail_settings,category_icon,ectouch,weixintong,order_os_edit,order_ps_edit,order_ss_edit,order_edit,order_view,order_view_finished,repay_manage,booking,sale_order_stats,client_flow_stats,delivery_view,back_view,topic_manage,snatch_manage,bonus_manage,gift_manage,card_manage,pack,ad_manage,auction,group_by,favourable,whole_sale,package_manage,exchange_goods,template_select,template_setup,library_manage,lang_edit,backup_setting,mail_template,db_backup,db_renew,db_optimize,sql_query,convert,wx_api,wx_menu,wx_config,wx_bonus,wx_regmsg,wx_lang,wx_keywords,wx_point,wx_fun,wx_prize,wx_zjd,wx_dzp,wx_qr,wx_order,wx_pay,wx_reorder,wx_fans,wx_oauth,wx_tuijian,wx_list,wx_autoreg,affiliate,affiliate_ck,zdy_parent,danpin_tuiguang');");
require "../../inc/footer.php";