当前位置: 首页>>代码示例>>PHP>>正文


PHP DedeSql::SetQuery方法代码示例

本文整理汇总了PHP中DedeSql::SetQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP DedeSql::SetQuery方法的具体用法?PHP DedeSql::SetQuery怎么用?PHP DedeSql::SetQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DedeSql的用法示例。


在下文中一共展示了DedeSql::SetQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetOptionList

function GetOptionList($selid=0,$userCatalog=0,$channeltype=0)
{
    global $OptionArrayList,$channels,$dsql;
    
    if(!is_object($dsql)) $dsql = new DedeSql(false);
    
    $dsql->SetQuery("Select ID,typename From #@__channeltype ");
    $dsql->Execute();
    $channels = Array();
    while($row = $dsql->GetObject()) $channels[$row->ID] = $row->typename;
    
    $OptionArrayList = "";
    
    $query = "Select ID,typename,ispart,channeltype,issend From #@__arctype where ispart<>2 And reID=0 order by sortrank asc ";
      
    $dsql->SetQuery($query);
    $dsql->Execute();
    	
    while($row=$dsql->GetObject())
    {
        if($row->channeltype==$channeltype && $row->issend==1){
        	 if($row->ispart==0) $OptionArrayList .= "<option value='".$row->ID."' class='option3'>".$row->typename."</option>\r\n";
           else if($row->ispart==1) $OptionArrayList .= "<option value='".$row->ID."' class='option2'>".$row->typename."</option>\r\n";
        }
        LogicGetOptionArray($row->ID,"─",$channeltype,$dsql);
    }
     
    return $OptionArrayList; 
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:29,代码来源:inc_catalog_options.php

示例2: GetRankName

function GetRankName($arcrank)
{
	global $arcArray,$dsql;
	if(!is_array($arcArray)){
		$dsql = new DedeSql(false);
		$dsql->SetQuery("Select * from #@__arcrank");
		$dsql->Execute('rn1');
		while($row = $dsql->GetObject('rn1')){ $arcArray[$row->rank]=$row->membername; }
	}
	if(isset($arcArray[$arcrank])) return $arcArray[$arcrank];
	else return "不限";
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:12,代码来源:inc_list_functions.php

示例3: if

	}
	else if($dbptype==3){
		$dsql = new DedeSql(false,false);
		$dsql->SetSource($dbhost,$dbuser,$dbpwd,$dbname,'');
		$dsql->Open(false);
	}
	if(!$dsql->linkID){
		ShowMsg("连接数据源的数据库失败!","javascript:;");
		exit();
	}
	$fieldsql = '';
	$fieldsql = "$userfield,$pwdfield";
	if($emailfield!='') $fieldsql .= ",$emailfield";
	if($unamefield!='') $fieldsql .= ",$unamefield";
	if($sexfield!='') $fieldsql .= ",$sexfield";
	$dsql->SetQuery("Select $fieldsql From $exptable ");
	$dsql->Execute();
	
	$cfg_db_language = $oldchar;
	$dsql2 = new DedeSql(false);
	
	$c = 0;
	
	while($row = $dsql->GetArray()){
		$userid = addslashes($row[$userfield]);
		if($tgtype=='none') $pwd = GetEncodePwd($row[$pwdfield]);
		else if($tgtype=='md5'){
			if($cfg_md5len < $tgmd5len) $pwd = substr($row[$pwdfield],0,$cfg_md5len);
			else $pwd = $row[$pwdfield];
		}else if($tgtype=='md5m16'){
			$pwd = $row[$pwdfield];
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:member_data_action.php

示例4: GetMkTime

	$endtime = GetMkTime($endtime);
	$voteitems = "";
	$j=0;
	for($i=1;$i<=15;$i++)
	{
		if(!empty(${"voteitem".$i})){
			$j++;
			$voteitems .= "<v:note id=\\'$j\\' count=\\'0\\'>".${"voteitem".$i}."</v:note>\r\n";
		}
	}
	$dsql = new DedeSql(false);
	$inQuery = "
	insert into #@__vote(votename,starttime,endtime,totalcount,ismore,votenote) 
	Values('$votename','$starttime','$endtime','0','$ismore','$voteitems');
	";
	$dsql->SetQuery($inQuery);
	if(!$dsql->ExecuteNoneQuery())
	{
		$dsql->Close();
		ShowMsg("增加投票失败,请检查数据是否非法!","-1");
		exit();
	}
	$dsql->Close();
	ShowMsg("成功增加一组投票!","vote_main.php");
	exit();
}
$startDay = time();
$endDay = AddDay($startDay,30);
$startDay = GetDateTimeMk($startDay);
$endDay = GetDateTimeMk($endDay);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:vote_add.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(dirname(__FILE__)."/config.php");
CheckPurview('sys_MakeHtml');
$dsql = new DedeSql(false);
$cids = '';
$dsql->SetQuery("Select ID From `#@__channeltype` ");
$dsql->Execute();
while($row = $dsql->GetArray())
{
	$cids .= ($cids=='' ? $row[0] : ','.$row[0]);
}

if($cids!='')
{
  $rs = $dsql->ExecuteNoneQuery("Delete From `#@__arctype` where NOT (channeltype in ($cids));");
  if($rs>0){
  	$dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__arctype`;");
  	UpDateCatCache($dsql);
  }

  $rs = $dsql->ExecuteNoneQuery("Delete From `#@__full_search` where  NOT (channeltype in ($cids));");
  if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__full_search`;");

  $rs = $dsql->ExecuteNoneQuery("Delete From `#@__archives` where  NOT (channel in ($cids));");
  if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__archives`;");
  
  $rs = $dsql->ExecuteNoneQuery("Delete From `#@__archivesspec` where  NOT (channel in ($cids));");
  if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__archivesspec`;");

}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:archives_clear.php

示例7: array

	}
}

foreach($topsectors as $topsector){
	$sectors[] = $topsector;
	foreach($subsectors as $key => $subsector){
		if($subsector['reid'] == $topsector['id']){
			$sectors[] = $subsector;
			unset($subsectors[$key]);
		}
	}
}

//////////////////////地区数据处理s/////////////////////////////
$sql = "select * from #@__area order by disorder asc,id asc";
$dsql->SetQuery($sql);
$dsql->Execute();
$toparea = $subarea = array();
while($sector = $dsql->GetArray())
{
	$areas[$sector['id']] = $sector['name'];

	if($sector['reid'] == 0)
	{
		$toparea[] = $sector;
	}else
	{
		$subarea[] = $sector;
	}
}
$areacache = "toparea=new Array();\n\n";
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:index.php

示例8: DedeSql

empty($_COOKIE['ENV_GOBACK_URL']) ? $ENV_GOBACK_URL = "article_keywords_main.php" : $ENV_GOBACK_URL=$_COOKIE['ENV_GOBACK_URL'];
if(!isset($aids)){
	ShowMsg("你没有选择要更改的东东!",$ENV_GOBACK_URL);
	exit();
}
$dsql = new DedeSql(false);
foreach($aids as $aid)
{
	$rpurl = ${'rpurl_'.$aid};
	$rpurlold = ${'rpurlold_'.$aid};
	$keyword = ${'keyword_'.$aid};
	//删除项目
	if(!empty(${'isdel_'.$aid}))
	{
		 $query = "update #@__full_search set keywords = Replace(keywords,' $keyword ',' ')";
     $dsql->SetQuery($query);
	   $dsql->ExecuteNoneQuery();
	   $dsql->SetQuery("Delete From #@__keywords where aid='$aid'");
     $dsql->ExecuteNoneQuery();
     continue;
	}
	//禁用项目
	$staold = ${'staold_'.$aid};
	if(!empty(${'isnouse_'.$aid})) $sta = 0;
	else $sta = 1;
	if($staold!=$sta)
	{
		$query1 = "update #@__keywords set sta='$sta',rpurl='$rpurl' where aid='$aid' ";
	  $dsql->SetQuery($query1);
	  $dsql->ExecuteNoneQuery();
	  if($sta==0)
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:article_keywords_saveall.php

示例9: if

}
/*--------------------
   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' ");
	//更新图书记录
	$row = $dsql->GetOne("Select count(id) as dd From #@__story_content where bookid='$bookid' ");
	$dsql->ExecuteNoneQuery("Update #@__story_books set postnum='{$row['dd']}' where id='$bookid' ");
	$dsql->Close();
	ShowMsg("成功删除指定章节!",$ENV_GOBACK_URL);
	exit();
	exit();
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:story_do.php

示例10: DedeSql

header("Content-Type: text/html; charset=utf-8");
$dsql = new DedeSql(false);
$cfg_templets_dir = $cfg_basedir . $cfg_templets_dir;
$channellist = '';
$newartlist = '';
$channellistnext = '';
if (empty($action)) {
    $action = 'index';
} elseif ($action != 'list' && $action != 'index' && $action != 'article' && $action != 'allArticle' && $action != 'allList') {
    die('action error');
}
//$hostName = '/m';
$hostName = $action == 'index' ? '.' : '..';
//用相对地址
//顶级导航列表
$dsql->SetQuery("Select id,typename From `#@__arctype` where reid=0 And channeltype=1 And ishidden=0 And ispart<>2 order by sortrank limit 0,10");
$dsql->Execute();
$channellist = '<li><a href="' . $hostName . '">首页</a></li>';
while ($row = $dsql->GetObject()) {
    $channellist .= "<li><a href='{$hostName}/list/{$row->id}.html'>{$row->typename}</a></li>";
}
//当前时间
$curtime = strftime("%Y-%m-%d %H:%M:%S", time());
//站点名称
$cfg_webname = ConvertStr($cfg_webname);
//主页
if ($action == 'index') {
    //最新文章10篇
    $dsql->SetQuery("Select id,title,pubdate From `#@__archives` where channel=1 And arcrank = 0 order by pubdate desc limit 0,10");
    $dsql->Execute();
    while ($row = $dsql->GetObject()) {
开发者ID:stonelf,项目名称:mcgmh,代码行数:31,代码来源:makeMobileHtml.php

示例11: int

  	ClearAllLink();
  	ShowMsg("你修改的是系统专用类型的数据,禁止操作!","-1");
  	exit();
  }
  
  //检测数据库是否存在附加表,不存在则新建一个
  $tabsql = "CREATE TABLE IF NOT EXISTS  `{$row['addtable']}`( `aid` int(11) NOT NULL default '0',\r\n `typeid` int(11) NOT NULL default '0',\r\n ";
  if($mysql_version < 4.1)
    $tabsql .= " PRIMARY KEY  (`aid`), KEY `".$trueTable."_index` (`typeid`)\r\n) TYPE=MyISAM; ";
  else
    $tabsql .= " PRIMARY KEY  (`aid`), KEY `".$trueTable."_index` (`typeid`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; ";
  $dsql->ExecuteNoneQuery($tabsql);
  
  //检测附加表里含有的字段
	$fields = array();
  $rs = $dsql->SetQuery("show fields from `{$row['addtable']}`");
  $dsql->Execute('a');
  
  while($nrow = $dsql->GetArray('a',MYSQL_ASSOC)){
	  $fields[ strtolower($nrow['Field']) ] = $nrow['Type'];
  }
	
	//修改字段配置信息
	$dfvalue = $vdefault;
	$isnull = ($isnull==1 ? "true" : "false");
	$mxlen = $maxlength;
	$fieldname = strtolower($fname);
	
	
	//检测被修改的字段类型,并更新数据表
	$fieldinfos = GetFieldMake($dtype,$fieldname,$dfvalue,$mxlen);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:mychannel_field_edit.php

示例12: __AddMoney

  }
}
/*----------------
function __AddMoney()
会员充值
----------------*/
else if($dopost=="addmoney")
{
	CheckPurview('member_Edit');

	if($fmdo=="yes")
	{
		$ID = ereg_replace("[^0-9]","",$ID);
		$money = ereg_replace("[^0-9]","",$money);
		$dsql = new DedeSql(false);
		$dsql->SetQuery("update #@__member set money=money+$money where ID='$ID'");
		$dsql->ExecuteNoneQuery();
		$dsql->Close();
		ShowMsg("成功给一个会员充值!",$ENV_GOBACK_URL);
		exit();
	}
	if(empty($upmoney)) $upmoney = 500;
	$wintitle = "会员管理-会员充值";
	$wecome_info = "<a href='".$ENV_GOBACK_URL."'>会员管理</a>::会员充值";
	$win = new OxWindow();
	$win->Init("member_do.php","js/blank.js","POST");
	$win->AddHidden("fmdo","yes");
	$win->AddHidden("dopost",$dopost);
	$win->AddHidden("ID",$ID);
	$win->AddTitle("会员充值:");
	$win->AddMsgItem("请输入充值点数:<input type='text' name='money' size='10' value='$upmoney'>",60);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:member_do.php

示例13: upRank

function upRank()
------------------------*/
else if($dopost=="upRank")
{
	//检查权限许可
  CheckPurview('t_Edit,t_AccEdit');
  //检查栏目操作许可
  CheckCatalog($cid,"你无权更改本栏目!");
	$dsql = new DedeSql(false);
	$row = $dsql->GetOne("Select reID,sortrank From #@__arctype where ID='$cid'");
	$reID = $row['reID'];
	$sortrank = $row['sortrank'];
	$row = $dsql->GetOne("Select sortrank From #@__arctype where sortrank<=$sortrank And reID=$reID order by sortrank desc ");
	if(is_array($row)){
		$sortrank = $row['sortrank']-1;
		$dsql->SetQuery("update #@__arctype set sortrank='$sortrank' where ID='$cid'");
		$dsql->ExecuteNoneQuery();
	}
	$dsql->Close();
	ShowMsg("操作成功,返回目录...","catalog_main.php");
	exit();
}
else if($dopost=="upRankAll")
{
	//检查权限许可
  CheckPurview('t_Edit');
	$dsql = new DedeSql(false);
	$row = $dsql->GetOne("Select ID From #@__arctype order by ID desc");
	if(is_array($row))
	{
		$maxID = $row['ID'];
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:catalog_do.php

示例14: DedeSql

</td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2" align="center" class="mma">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<?php
if(!isset($dsql) || !is_object($dsql)){
	$dsql = new DedeSql(false);
}
$addQuery = "";
if(!empty($channelid)){
	$channelid = ereg_replace("[^0-9]","",$channelid);
	$addQuery = " And channelid='$channelid' ";
}
$userNumID = ereg_replace("[^0-9]","",$userNumID);
$dsql->SetQuery("Select * From #@__member_arctype where memberid='$userNumID' $addQuery order by rank desc; ");
$dsql->Execute();
while($menurow = $dsql->GetArray())
{
	if($menurow['channelid']==1) $tf = '<img src="img/dd/exe.gif" width="16" height="16">';
	else $tf='<img src="img/dd/image.gif" width="16" height="16">';
?>
 <tr>
<td align="right" class="mmbb" height="24" width="30%" style="padding-right:6px"><?php echo $tf?></td>
 <td class="mmbb">
 <a href='member_archives.php?uid=<?php echo $uid?>&channelid=<?php echo $menurow['channelid']?>&mtype=<?php echo $menurow['aid']?>'><?php echo $menurow['typename']?></a>
 </td>
 </tr>
<?php
}
?>
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:com_menu.php

示例15: pr_str_replace

function pr_str_replace($str)
{
    $dsql = new DedeSql(false);
    $dsql->SetQuery("SELECT * FROM `#@__str_replace`");
    $dsql->Execute();
    while ($row = $dsql->GetArray()) {
        if ($row['interconvert'] == 1) {
            $str = str_replace($row['find'], "@@@@", $str);
            $str = str_replace($row['replace'], $row['find'], $str);
            $str = str_replace("@@@@", $row['replace'], $str);
        } else {
            if ($row['interconvert'] == 0) {
                $str = str_replace($row['find'], $row['replace'], $str);
            }
        }
    }
    return $str;
}
开发者ID:soonfine,项目名称:leread,代码行数:18,代码来源:common.func.php


注:本文中的DedeSql::SetQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。