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


PHP DedeSql::getone方法代码示例

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


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

示例1: DedeSql

	
	header("Content-Type: text/html; charset={$cfg_ver_lang}");
	$dsql = new DedeSql(false);
	if(empty($startdd)) $startdd = 0;
	if(empty($pagesize)) $pagesize = 100;
	if(empty($totalnum)) $totalnum = 0;
	if(empty($sid)) $sid = 0;
	if(empty($eid)) $eid = 0;
	if(empty($dojob)) $dojob = 'desc';
	$addtable = urldecode($addtable);
	$addtable = ereg_replace("[^0-9a-zA-Z_#@]","",$addtable);
	$rpfield = ereg_replace("[^0-9a-zA-Z_\[\]]","",$rpfield);

	$channel = intval($channel);
	if($dsize>250) $dsize = 250;
	$channelinfo = $dsql->getone("select * from #@__channeltype where ID=$channel");
	$maintable = $channelinfo['maintable'];
	if(empty($totalnum)){
		$addquery  = "";
		if($sid!=0) $addquery  = " And aid>='$sid' ";
		if($eid!=0) $addquery  = " And aid<='$eid' ";
		$tjQuery = "Select count(*) as dd From #@__full_search where channelid='{$channel}' $addquery";
		$row = $dsql->GetOne($tjQuery);
		$totalnum = $row['dd'];
	}
	if($totalnum > 0){
	    $addquery  = "";
	    if($sid!=0) $addquery  = " And maintable.ID>='$sid' ";
	    if($eid!=0) $addquery  = " And maintable.ID<='$eid' ";
	    $fquery = "
	      Select maintable.ID,maintable.title,maintable.description,addtable.{$rpfield} as body
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:30,代码来源:description_fetch_action.php

示例2: DedeSql

<?php
require_once(dirname(__FILE__)."/config.php");
@set_time_limit(0);
CheckPurview('sys_ArcBatch');
if(empty($dopost)) $dopost = '';

$dsql = new DedeSql(false);

if($dopost=='analyse'){
	$channelid = intval($channelid);
	$maintable = $dsql->getone("select maintable from #@__channeltype where ID=$channelid");
	if(is_array($maintable)){
		$maintable = $maintable['maintable'];
	}else{
		$dsql->close();
		showmsg('频道id不正确,请重新选择频道','javascript:;');
		exit();
	}

	$dsql->SetQuery("Select count(title) as dd,title From $maintable where channel=$channelid group by title order by dd desc limit 0,$pagesize");
	$dsql->Execute();
	$allarc = 0;
	require_once(dirname(__FILE__)."/templets/article_result_same.htm");
	$dsql->Close();
	exit();
}else if($dopost=='delsel'){
	require_once(dirname(__FILE__)."/../include/inc_typelink.php");
	require_once(dirname(__FILE__)."/inc/inc_batchup.php");
	if(empty($titles)){
		$dsql->close();
		header("Content-Type: text/html; charset={$cfg_ver_lang}");
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:article_test_same.php

示例3:

	$dsql->setquery("select id, name, reid from #@__sectors
	where id=$sectorid or reid=$sectorid order by disorder desc,id asc");
	$dsql->Execute();
	while($row = $dsql->GetArray()) {
			if($row['id'] == $sectorid){
				$topsectorinfo = $sectorinfo = $row;
			}else{
				$subsectors[] = $row;
			}
	}

	$wheresql .= " and typeid1=$sectorid";

}elseif($sectorid2 > 0)
{
	$sectorinfo = $dsql->getone("select id, name, reid from #@__sectors where id=$sectorid2");
	if($sectorinfo){
		$sectorid = $sectorinfo['reid'];
		$dsql->setquery("select id, name, reid from #@__sectors
		where id=$sectorid or reid=$sectorid order by disorder desc,id asc");
		$dsql->Execute();
		while($row = $dsql->GetArray()) {

				if($row['id'] == $sectorid){
					$topsectorinfo = $row;
				}else{
					$subsectors[] = $row;
				}
		}
		$sectorid = 0;
	}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:search.php

示例4: __getfields

require_once(dirname(__FILE__)."/../include/pub_splitword_www.php");
if(empty($action)) $action = '';
/*-------------------------------
//列出数据库表里的字段
function __getfields()
--------------------------------*/
if($action=='getfields')
{
	AjaxHead();
	$dsql = new DedeSql(false);
	if(!$dsql->linkID){
		echo "<font color='red'>连接数据源的数据库失败!</font><br>";
		echo $qbutton;
		exit();
	}
	$exptable = $dsql->getone("select addtable from #@__channeltype where ID=$exptable");
	$exptable = str_replace('#@__',$cfg_dbprefix,$exptable['addtable']);
	$dsql->GetTableFields($exptable);
	echo "<div style='border:1px solid #ababab;background-color:#FEFFF0;margin-top:6px;padding:3px;line-height:160%'>";
	echo "表(".$exptable.")含有的字段:<br>";
	while($row = $dsql->GetFieldObject()){
		echo "<a href=\"javascript:pf('{$row->name}')\"><u>".$row->name."</u></a>\r\n";
	}
	echo "<input type='hidden' name='addtable' value='$exptable' />";
	echo "</div>";
	$dsql->Close();
	exit();
}elseif($action == 'fetch')
{
  header("Content-Type: text/html; charset={$cfg_ver_lang}");
	$dsql = new DedeSql(false);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:keywords_fetch_action.php


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