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


PHP DedeSql::setquery方法代码示例

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


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

示例1: DedeSql

<?php
//require_once(dirname(__FILE__)."./../include/config_base.php");
require_once(dirname(__FILE__)."./../member/config.php");

$dsql = new DedeSql(false);
$areas = $sectors = $topsectors = $subsectors = array();
$dsql->setquery("select id, name, reid from #@__sectors order by disorder desc,id asc");
$dsql->Execute();
while($row = $dsql->GetArray())
{
	if($row['reid'] == 0){
		$topsectors[] = $row;
	}else{
		$subsectors[] = $row;
	}
}

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();
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:index.php

示例2: while

		 }
		 $dsql->SetQuery($q1);
		 $dsql->Execute();
		 $rownum = $dsql->GetTotalRow();
		 if($rownum<2) continue;
		 $i = 1;
		 while($row = $dsql->GetObject()){
		 	 $i++;
		 	 $naid = $row->ID;
		 	 $ntitle = $row->title;
		 	 if($i > $rownum){ continue; }
		 	 $totalarc++;
		 	 DelArc($naid);
		 }
	}
	$dsql->executenonequery("OPTIMIZE TABLE `$maintable`");
	$dsql->Close();
	ShowMsg("一共删除了[{$totalarc}]篇重复的文档!","javascript:;");
	exit();
}

$channelinfos = array();
$dsql->setquery("select ID,typename,maintable,addtable from #@__channeltype");
$dsql->execute();
while($row = $dsql->getarray())
{
	$channelinfos[] = $row;
}
require_once(dirname(__FILE__)."/templets/article_test_same.htm");
ClearAllLink();
?>
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:article_test_same.php

示例3: intval

if(empty($areaid)) $areaid = 0;
if(empty($areaid2)) $areaid2 = 0;
if(!isset($sectorid)) $sectorid = 0;
if(!isset($sectorid2)) $sectorid2 = 0;
if(empty($page)) $page = 1;

$areaid = intval($areaid);
$areaid2 = intval($areaid2);
$sectorid = intval($sectorid);
$sectorid2 = intval($sectorid2);
$page = intval($page);

isset($comname) || $comname = '';
$comname = trim($comname);
$allsectors = $areas = array();
$dsql->setquery("select id, name from #@__sectors order by disorder desc,id asc");
$dsql->Execute();
while($row = $dsql->getarray())
{
	$allsectors[$row['id']] = $row['name'];

}

	//////////////////////地区数据处理s/////////////////////////////
		$sql = "select * from #@__area order by disorder desc,id asc";
		$dsql->SetQuery($sql);
		$dsql->Execute();
		$toparea = $subarea = array();
		while($sector = $dsql->GetArray())
		{
			$areas[$sector['id']] = $sector['name'];
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:search.php

示例4: DedeSql

<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/inc_typelink.php");
require_once(dirname(__FILE__)."/inc/inc_batchup.php");
CheckPurview('sys_ArcBatch');
@set_time_limit(0);
$dsql = new DedeSql(false);
if($action=='modddpic')
{
	$query = "select ID,maintable from #@__channeltype";
	$dsql->setquery($query);
	$dsql->execute();
	$channels = array();
	while($row = $dsql->getarray())
	{
		$channels[$row['ID']] = $row['maintable'];
	}
	$query = "select aid, litpic,channelid from #@__full_search where litpic<>''";
	$dsql->setquery($query);
	$dsql->execute('litpic');
	while($row = $dsql->getarray('litpic'))
	{
		if(!preg_match("/^http:\/\//i",$row['litpic'])){
			if(!file_exists($row['litpic'])){
				$query = "update #@__full_search set litpic='' where aid=".$row['aid']." limit 1";
				$dsql->executenonequery($query);
				$maintable = $channels[$row['channelid']];
				$query = "update ".$maintable." set litpic='' where aid=".$row['aid']." limit 1";
				$dsql->executenonequery($query);
			}
		}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:content_batchup_action2.php


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