本文整理汇总了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
示例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}");
示例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;
}
示例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);