當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DedeSql::GetOne方法代碼示例

本文整理匯總了PHP中DedeSql::GetOne方法的典型用法代碼示例。如果您正苦於以下問題:PHP DedeSql::GetOne方法的具體用法?PHP DedeSql::GetOne怎麽用?PHP DedeSql::GetOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DedeSql的用法示例。


在下文中一共展示了DedeSql::GetOne方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: editSgTemplet

	$lv->Close();
 	$row['typedir'] = eregi_replace("\{cmspath\}",$cfg_cmspath,$row['typedir']);
 	$editurl = "file_manage_view.php?backurl=catalog_main.php&fmdo=editview&ishead=yes&filename=".$row['defaultname']."&activepath=".urlencode($row['typedir'])."&job=edit";
 	header("location:$editurl");
 	exit();
}
/*-----------
編輯模板頁麵
function editSgTemplet();
-----------*/
else if($dopost=="editSgTemplet")
{
  //檢查權限許可
  CheckPurview('plus_文件管理器');
	$dsql = new DedeSql(false);
	$row = $dsql->GetOne("Select tempone From #@__arctype where ID='$cid'");
	$dsql->Close();
	$tempone = $row['tempone'];
	$tempone = eregi_replace("\{style\}",$cfg_df_style,$tempone);
	if(!is_file($cfg_basedir.$cfg_templets_dir."/".$tempone)){
		ShowMsg("這個單獨頁麵沒有使用模板,現在轉向直接編輯這個頁麵。","catalog_do.php?cid=$cid&dopost=editSgPage");
		exit();
	}
	$tempones = explode('/',$tempone);
	$filename = $tempones[count($tempones)-1];
	$tmpdir = $cfg_templets_dir;
	if(count($tempones)>1){
	  foreach($tempones as $v){
		  if($v!="") $tmpdir .= "/".$v;
	  }
  }
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:catalog_do.php

示例2: DedeSql

	$rs = $dsql->ExecuteNoneQuery($query);
	if($rs){
		$chapterid = $dsql->GetLastID();
	}
	else
  {
  	ShowMsg("增加章節失敗,請檢查原因!","-1");
		exit();
  }
}else
{
	$dsql = new DedeSql();
}

//獲得父欄目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];

$addtime = time();


//本章最後一個漫畫的排列順次序
$lrow = $dsql->GetOne("Select sortid From #@__story_content where bookid='$bookid' And chapterid='$chapterid' order by sortid desc");
if(empty($lrow)) $sortid = 1;
else $sortid = $lrow['sortid']+1;

//處理上傳的圖片

if(!isset($isremote)) $isremote = 0;
//$bigpic = UploadOneImage('bigpic',$bigpicname,$ddisremote);
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:story_add_photo_action.php

示例3: trim

<?php 
require_once(dirname(__FILE__)."/config.php");
empty($_COOKIE['ENV_GOBACK_URL']) ? $ENV_GOBACK_URL = "-1" : $ENV_GOBACK_URL=$_COOKIE['ENV_GOBACK_URL'];
CheckPurview('sys_Keyword');
$keyword = trim($keyword);
$rank = ereg_replace("[^0-9]","",$rank);
if(ereg(" ",$keyword)||$keyword=="")
{
	ShowMsg("關鍵字不能帶有空格或為空!",-1);
	exit();
}
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select * From #@__keywords where keyword like '$keyword'");
if(is_array($row))
{
	$dsql->Close();
	ShowMsg("關鍵字已存在庫中!","-1");
	exit();
}
$inquery = "
INSERT INTO #@__keywords(keyword,rank,sta,rpurl) VALUES ('$keyword','$rank','1','$rpurl');
";
$dsql->SetQuery($inquery);
$dsql->ExecuteNoneQuery();
ClearAllLink();
ShowMsg("成功增加一個關鍵字!",$ENV_GOBACK_URL);
?>
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:27,代碼來源:article_keywords_add.php

示例4: 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;
		}
	}
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:32,代碼來源:inc_userlogin.php

示例5: if

<?php 
require_once(dirname(__FILE__)."/config.php");
CheckPurview('plus_站內新聞發布');
if(empty($dopost)) $dopost = "";
$aid = ereg_replace("[^0-9]","",$aid);
$dsql = new DedeSql(false);
if($dopost=="del")
{
	 $dsql->SetQuery("Delete From #@__mynews where aid='$aid';");
	 $dsql->ExecuteNoneQuery();
	 $dsql->Close();
	 ShowMsg("成功刪除一條站內新聞!","mynews_main.php");
	 exit();
}
else if($dopost=="editsave")
{
	$dsql->SetQuery("Update #@__mynews set title='$title',typeid='$typeid',writer='$writer',senddate='".GetMKTime($sdate)."',body='$body' where aid='$aid';");
	$dsql->ExecuteNoneQuery();
	$dsql->Close();
	ShowMsg("成功更改一條站內新聞!","mynews_main.php");
	exit();
}
$myNews = $dsql->GetOne("Select #@__mynews.*,#@__arctype.typename From #@__mynews left join #@__arctype on #@__arctype.ID=#@__mynews.typeid where #@__mynews.aid='$aid';");

require_once(dirname(__FILE__)."/templets/mynews_edit.htm");

ClearAllLink();
?>
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:28,代碼來源:mynews_edit.php

示例6: DedeSql

<?php
require_once(dirname(__FILE__)."/config.php");
AjaxHead();
if(empty($t)) echo '';
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select aid From #@__full_search where title like '$t' ");
$dsql->Close();
if(is_array($row)) echo "提示:係統已經存在標題為 '<a href='../plus/view.php?aid={$row['aid']}' style='color:red' target='_blank'><u>$t</u></a>' 的文檔。[<a href='#' onclick='javascript:HideObj(\"_mytitle\")'>關閉</a>]";
else echo '';
?>
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:10,代碼來源:article_test_title.php

示例7: DedeSql

require_once(dirname(__FILE__)."/../config.php");
CheckPurview('story_New');
require_once(dirname(__FILE__)."/../../include/inc_photograph.php");
require_once(dirname(__FILE__)."/../../include/pub_oxwindow.php");
require_once(dirname(__FILE__)."/../inc/inc_archives_functions.php");

if(!isset($iscommend)) $iscommend = 0;

if($catid==0){
	ShowMsg("請指定圖書所屬欄目!","-1");
	exit();
}

$dsql = new DedeSql(false);
//獲得父欄目
$nrow = $dsql->GetOne("Select * From #@__story_catalog where id='$catid' ");
$bcatid = $nrow['pid'];
$booktype = $nrow['booktype'];

$pubdate = GetMkTime($pubdate);

$bookname = cn_substr($bookname,50);

if($keywords!="") $keywords = trim(cn_substr($keywords,60));

//處理上傳的縮略圖
$litpic = GetDDImage('litpic',$litpicname,0);

$adminID = $cuserLogin->getUserID();

//自動摘要
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:story_edit_action.php

示例8: if

<?php 
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_MakeHtml');
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
$dsql = new DedeSql(false);
$action = (empty($action) ? '' : $action);
if($action=='')
{
  $row = $dsql->GetOne("Select * From `#@__task`");
  if(!is_array($row))
  {
  	$ks = explode(',','usermtools,rmpwd,tasks,typeid,startid,endid,nodes,dotime,degree');
  	foreach($ks as $k) $row[$k] = '';
  	$row['dotime'] = '02:30:00';
  	$row['usermtools'] = '1';
  }
  require_once(dirname(__FILE__)."/templets/makehtml_task.htm");
  $dsql->Close();
  exit();
}
else if($action=='save')
{
	if(!is_array($tasks)){
		ShowMsg("你沒選擇需要操作的任務!","-1");
	  exit();
	}
	if(empty($rmpwd)){
		ShowMsg("遠程管理密碼不能為空!","-1");
	  exit();
	}
	if(eregi("[^0-9a-z@!]",$rmpwd)){
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:makehtml_task.php

示例9: if

{
	$dsql = new DedeSql();
	$dsql->ExecuteNoneQuery("Update #@__story_chapter set chaptername='$chaptername',chapnum='$chapnum' where id='$cid' ");
	AjaxHead();
	echo "<font color='red'>成功更新章節:{$chaptername} ! [<a href=\"javascript:CloseLayer('editchapter')\">關閉提示</a>]</font> <br /><br /> 提示:修改章節名稱或章節序號直接在左邊修改,然後點擊右邊的 [更新] 會保存。 ";
	$dsql->Close();
	exit();
}
/*--------------------
   function DelChapter()
   刪除章節信息
-------------------*/
else if($action=='delChapter')
{
	$dsql = new DedeSql();
	$row = $dsql->GetOne("Select c.bookid,b.booktype From #@__story_chapter c left join  #@__story_books b on b.id=c.bookid where c.id='$cid' ");
	$bookid = $row['bookid'];
	$booktype = $row['booktype'];
	$dsql->ExecuteNoneQuery("Delete From #@__story_chapter where id='$cid' ");
	//刪除圖片
	if($booktype==1)
	{
		$dsql->SetQuery("Select bigpic From #@__story_content where bookid='$bookid' ");
		$dsql->Execute();
		while($row = $dsql->GetArray()){
			$bigpic = $row['bigpic'];
			if( $bigpic!="" && !eregi('^http://',$bigpic) ) @unlink($cfg_basedir.$bigpic);
		}
	}
	$dsql->ExecuteNoneQuery("Delete From #@__story_content where chapterid='$cid' ");
	//更新圖書記錄
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:story_do.php

示例10: 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;
 	  }
  }
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:25,代碼來源:inc_memberlogin.php

示例11: die

    ob_start();
    include $cfg_templets_dir . "/mobile/index.htm";
    $pageBody = ob_get_contents();
    ob_end_clean();
    $fp = @fopen('../m/index.html', 'w') or die('讀取失敗,確定有寫入權限?');
    fwrite($fp, $pageBody);
    fclose($fp);
    exit('更新主頁成功');
} else {
    if ($action == 'list') {
        $id = ereg_replace("[^0-9]", '', $id);
        if (empty($id)) {
            exit('List Error!');
        }
        require DEDEINC . "/datalistcpWap.class.php";
        $row = $dsql->GetOne("Select typename,ishidden, description,seotitle,keywords From `#@__arctype` where id='{$id}' ");
        if ($row['ishidden'] == 1) {
            exit('this listID is hiddening');
        }
        $typename = ConvertStr($row['typename']);
        $keywords = ConvertStr($row['typename']);
        $description = ConvertStr($row['description']);
        $seotitle = ConvertStr($row['seotitle']);
        //當前欄目下級分類
        $dsql->SetQuery("Select id,typename From `#@__arctype` where reid='{$id}' And channeltype=1 And ishidden=0 And ispart<>2 order by sortrank");
        $dsql->Execute();
        while ($row = $dsql->GetObject()) {
            $channellistnext .= "<li><a href='{$hostName}/list/{$row->id}.html'>" . ConvertStr($row->typename) . "</a></li>";
        }
        //欄目內容(分頁輸出)
        $sids = GetSonIds($id, 1, true);
開發者ID:stonelf,項目名稱:mcgmh,代碼行數:31,代碼來源:makeMobileHtml.php

示例12: GetCoRank

function GetCoRank($arcrank,$typeid){
	 $dsql = new DedeSql(false);	  
	 $row = $dsql->GetOne("Select corank From #@__arctype where ID='$typeid' ");
	 if($row['corank']!=0) return $row['corank'];
	 else return $arcrank;
}
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:6,代碼來源:inc_archives_functions.php

示例13: _SAVE

<?php 
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
require_once(dirname(__FILE__)."/inc/inc_admin_channel.php");
if(empty($action)) $action = '';

//獲取模型信息
$dsql = new DedeSql(false);
$mysql_version = $dsql->GetVersion();
$mysql_versions = explode(".",trim($mysql_version));
$mysql_version = $mysql_versions[0].".".$mysql_versions[1];
$row = $dsql->GetOne("Select fieldset,maintable,addtable,issystem From #@__channeltype where ID='$ID'");
$fieldset = $row['fieldset'];
$trueTable = $row['addtable'];
$dtp = new DedeTagParse();
$dtp->SetNameSpace("field","<",">");
$dtp->LoadSource($fieldset);
foreach($dtp->CTags as $ctag){
	if(strtolower($ctag->GetName())==strtolower($fname)) break;
}

//字段類型信息
$ds = file(dirname(__FILE__)."/inc/fieldtype.txt");
foreach($ds as $d){
   $dds = explode(',',trim($d));
   $fieldtypes[$dds[0]] = $dds[1];
}

//保存更改
/*--------------------
function _SAVE()
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:31,代碼來源:mychannel_field_edit.php

示例14: DedeSql

<?php 
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_SoftConfig');
if(empty($dopost)) $dopost = "";
//保存
$dsql = new DedeSql(false);
$upok = '';
if($dopost=="save")
{
   $query = "UPDATE `#@__softconfig` SET downtype = '$downtype' , showlocal = '$showlocal', 
   gotojump='$gotojump' , ismoresite = '$ismoresite',sites = '$sites'";
   $dsql->SetQuery($query);
   $dsql->ExecuteNoneQuery();
   $upok = "<font color='red'>成功保存更改!</font>";
}
//讀取參數
$row = $dsql->GetOne("select * From #@__softconfig");
if(!is_array($row)){
	$dsql->ExecuteNoneQuery("INSERT INTO `#@__softconfig` ( `downtype` , `ismoresite` ,`showlocal` , `gotojump` , `sites` ) VALUES ('0', '0','0' , '0', '');");
	$row['downtype']=1;
	$row['ismoresite']=0;
	$row['sites']="";
	$row['gotojump']=0;
}

require_once(dirname(__FILE__)."/templets/soft_config.htm");

ClearAllLink();
?>
開發者ID:BGCX262,項目名稱:zyyhong-svn-to-git,代碼行數:29,代碼來源:soft_config.php

示例15: trim

$v_pmode = trim($_POST['v_pmode']);
$v_pstatus = trim($_POST['v_pstatus']);
$v_pstring = trim($_POST['v_pstring']);
$v_amount = trim($_POST['v_amount']);
$v_moneytype = trim($_POST['v_moneytype']);
$remark1 = trim($_POST['remark1']);
$remark2 = trim($_POST['remark2']);
$v_md5str = trim($_POST['v_md5str']);
$md5string = strtoupper(md5($v_oid . $v_pstatus . $v_amount . $v_moneytype . $key));
//拚湊加密串
if ($v_md5str == $md5string) {
    if ($v_pstatus == "20") {
        $dsql = new DedeSql(false);
        $buyid = $v_oid;
        //獲取訂單信息,檢查訂單的有效性
        $row = $dsql->GetOne("Select * From #@__member_operation where buyid='{$buyid}' ");
        if (!is_array($row) || $row['sta'] == 2) {
            $oldinfo = $row['oldinfo'];
        }
        $mid = $row['mid'];
        $pid = $row['pid'];
        //更新交易狀態為已付款
        $dsql->ExecuteNoneQuery("Update #@__member_operation set sta=1 where buyid='{$buyid}' ");
        //-------------------------------------------
        //會員產品
        //-------------------------------------------
        if ($row['product'] == 'member') {
            $row = $dsql->GetOne(" Select rank,exptime From #@__member_type where aid='{$row['pid']}' ");
            $rank = $row['rank'];
            $exptime = $row['exptime'];
            $equery = " Update #@__member set \r\n\t\t\t\t\t\t\t\t\tmembertype='{$rank}',exptime='{$exptime}',uptime='" . time() . "' where mid='{$mid}' ";
開發者ID:klr2003,項目名稱:sourceread,代碼行數:31,代碼來源:autoreceive.php


注:本文中的DedeSql::GetOne方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。