本文整理匯總了PHP中DedeSql::Close方法的典型用法代碼示例。如果您正苦於以下問題:PHP DedeSql::Close方法的具體用法?PHP DedeSql::Close怎麽用?PHP DedeSql::Close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DedeSql
的用法示例。
在下文中一共展示了DedeSql::Close方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetRankName
function GetRankName($arcrank)
{
global $arcArray;
if(!is_array($arcArray)){
$dsql = new DedeSql(false);
$dsql->SetQuery("Select * from #@__arcrank");
$dsql->Execute();
while($row = $dsql->GetObject()){ $arcArray[$row->rank]=$row->membername; }
$dsql->Close();
}
if(isset($arcArray[$arcrank])) return $arcArray[$arcrank];
else return "不限";
}
示例2: trim
$bodytext = preg_replace("/#p#|#e#|副標題|分頁標題/isU","",Html2Text($body));
if(strlen($bodytext) < $msize) continue;
$des = trim(addslashes(cn_substr($bodytext,$dsize)));
if(strlen($des)<3) $des = "-";
$dsql->ExecuteNoneQuery("Update $maintable set description='{$des}' where ID='{$row['ID']}';");
$dsql->ExecuteNoneQuery("Update #@__full_search set addinfos='{$des}' where aid='{$row['ID']}';");
}
//返回進度信息
$startdd = $startdd + $pagesize;
if($totalnum > $startdd){
$tjlen = ceil( ($startdd/$totalnum) * 100 );
$dvlen = $tjlen * 2;
$tjsta = "<div style='width:200;height:15;border:1px solid #898989;text-align:left'><div style='width:$dvlen;height:15;background-color:#829D83'></div></div>";
$tjsta .= "<br/>完成處理文檔總數的:$tjlen %,繼續執行任務...";
$nurl = "description_fetch_action.php?action=fetch&totalnum=$totalnum&startdd={$startdd}&pagesize=$pagesize&channel={$channel}&rpfield={$rpfield}&dsize={$dsize}&msize={$msize}&sid={$sid}&eid=$eid&addtable=".urlencode($addtable);
$dsql->Close();
ShowMsg($tjsta,$nurl,0,500);
exit();
}else{
$tjlen=100;
$dsql->executenonequery("OPTIMIZE TABLE `#@__full_search`");
$dsql->executenonequery("OPTIMIZE TABLE `$maintable`");
$dsql->Close();
echo "完成所有任務!";
exit();
}
}else{
$dsql->Close();
echo "完成所有任務!";
exit();
}
示例3: checkUser
function checkUser($username,$userpwd)
{
//隻允許用戶名和密碼用0-9,a-z,A-Z,'@','_','.','-'這些字符
$this->userName = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$username);
$this->userPwd = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$userpwd);
$pwd = substr(md5($this->userPwd),0,24);
$dsql = new DedeSql(false);
$dsql->SetQuery("Select * From #@__admin where userid='".$this->userName."' limit 0,1");
$dsql->Execute();
$row = $dsql->GetObject();
if(!isset($row->pwd)){
$dsql->Close();
return -1;
}
else if($pwd!=$row->pwd){
$dsql->Close();
return -2;
}
else{
$loginip = GetIP();
$this->userID = $row->ID;
$this->userType = $row->usertype;
$this->userChannel = $row->typeid;
$this->userName = $row->uname;
$groupSet = $dsql->GetOne("Select * From #@__admintype where rank='".$row->usertype."'");
$this->userPurview = $groupSet['purviews'];
$dsql->SetQuery("update #@__admin set loginip='$loginip',logintime='".strftime("%Y-%m-%d %H:%M:%S",time())."' where ID='".$row->ID."'");
$dsql->ExecuteNoneQuery();
$dsql->Close();
return 1;
}
}
示例4: showmsg
if (ereg("^edit___", $k)) {
$v = ${$k};
} else {
continue;
}
$k = ereg_replace("^edit___", "", $k);
if (strlen($v) > 250) {
showmsg("{$k} 太長,不能超過250字節", '-1');
exit;
}
$savesql->ExecuteNoneQuery("Update #@__config set `config_value`='{$v}' where `config_name`='{$k}' ");
}
$savesql->SetQuery("Select `config_name`,`config_value` From `#@__config` order by `id` asc");
$savesql->Execute();
if ($savesql->GetTotalRow() <= 0) {
$savesql->Close();
ShowMsg("成功保存變量但從數據庫讀取所有數據時失敗,無法更新配置文件!", "javascript:;");
exit;
}
@copy($configfile, $configfile_bak);
$fp = @fopen($configfile, 'w');
@flock($fp, 3);
@fwrite($fp, "<" . "?php\r\n") or die("配置文件'{$configfile}'不支持寫入,本次操作無效!<a href='system_basic.php'>返回</a>");
while ($row = $savesql->GetArray()) {
$row['value'] = str_replace("'", "\\'", $row['config_value']);
fwrite($fp, "\${$row['config_name']} = '" . $row['config_value'] . "';\r\n");
}
fwrite($fp, "?>");
fclose($fp);
$message = "成功修改了係統配置文件config_base.php";
$logindate = getdatetimemk(time());
示例5: GetFolders
require_once(dirname(__FILE__)."/config.php");
CheckPurview('member_Pm');
require_once(dirname(__FILE__)."/../include/pub_datalist.php");
require_once(dirname(__FILE__)."/../include/inc_functions.php");
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
if(!isset($folder)) $folder = '';
if(!isset($username)) $username = '';
if(!isset($keyword)) $keyword = '';
if(isset($dopost)){
$ID = ereg_replace("[^0-9]","",$ID);
if($dopost=="del"&&!empty($ID)){
$db = new DedeSql(false);
$db->ExecuteNoneQuery("DELETE FROM #@__pms WHERE pmid='$ID'");
$db->Close();
}
}
$whereSql = "WHERE folder='inbox' AND isadmin='0'";
if(!empty($folder)) $whereSql = "WHERE folder='$folder'";
$postuser = "收件人";
if($folder=="inbox"||$folder=='') $postuser = "發件人";
if(!empty($keyword)) $whereSql .= " AND (subject like '%".$keyword."%' OR message like '%".$keyword."%')";
if(!empty($username)) $whereSql .= " AND msgfrom like '%".$username."%'";
function GetFolders($me){
if($me=="track") return "發件箱";
示例6: CheckUser
function CheckUser($loginuser,$loginpwd)
{
if(!TestStringSafe($loginuser)||!TestStringSafe($loginpwd))
{
ShowMsg("用戶名或密碼不合法!","-1");
exit();
}
$loginuser = ereg_replace("[;%'\\\?\*\$]","",$loginuser);
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select ID,pwd From #@__member where userid='$loginuser' ");
if(is_array($row)) //用戶存在
{
//密碼錯誤
if($row['pwd'] != $loginpwd){ return -1; }
else{ //成功登錄
$dsql->ExecuteNoneQuery("update #@__member set logintime='".time()."',loginip='".GetIP()."' where ID='{$row['ID']}';");
$dsql->Close();
$this->PutLoginInfo($row['ID']);
$this->FushCache();
return 1;
}
}else{ //用戶不存在
return 0;
}
}
示例7: addslashes
if(empty($emailfield)) $email = '';
else $email = addslashes($row[$emailfield]);
if(empty($sexfield)) $sex = '';
else{
$sex = $row[$sexfield];
if($sex==$sexman) $sex = '男';
else if($sex==$sexwoman) $sex = '女';
else $sex = '';
}
$ntime = time();
$inQuery = "
INSERT INTO #@__member(userid,pwd,uname,sex,birthday,membertype,money,
weight,height,job,province,city,myinfo,tel,oicq,email,homepage,
jointime,joinip,logintime,loginip,showaddr,address)
VALUES ('$userid','$pwd','$uname','$sex','0000-00-00','10','0',
'0','0','','0','0','','','','$email','','$ntime','$loginip','$ntime','','0','');";
$rs = $dsql2->ExecuteNoneQuery($inQuery);
if($rs) $c++;
}
$dsql->Close();
$dsql2->Close();
ShowMsg("成功導入 ".$c." 條數據!","javascript:;");
exit();
}
ClearAllLink();
?>