当前位置: 首页>>代码示例>>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;未经允许,请勿转载。