當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。