为了便于使用,Druid 包中还提供了一个 SQL 命令行客户端工具,这个工具位于 bin/dsql 目录中。...如果你直接运行 bin/dsql 的话,你将会看到下面的提示输出: Welcome to dsql, the command-line client for Druid SQL....Type "\h" for help. dsql> 如果希望进行查询的话,将你的 SQL 张贴到 dsql 提示光标后面,然后单击回车: dsql> SELECT page, COUNT(*) AS Edits...如下图,就是我们使用 dsql 工具连接上我们一个服务器后进行查询的返回界面 上面的数据为服务器上真实的数据。 https://www.ossez.com/t/druid-dsql/13634
/dsql 运行命令行工具的话,将会显示连接的服务器地址为 http://localhost:8082/ 如果需要连接到其他的服务器地址,应该如何进行操作。.../dsql -H http://10.0.0.1:8080/ 来进行服务器的连接。 https://www.ossez.com/t/druid-dsql/13636
/dsql 你应该能够看到命令行提示工具。 如果能看到这个提示符的话,就表示 dsql 的配置已经正确了。...https://www.ossez.com/t/druid-dsql-urllib2/13635
= new DedeSql(false); //获取附加表 $row = $dsql->GetOne("SELECT c.addtable FROM dede_archives AS a LEFT...is_array($arcRow)) return false; /** 删除到回收站 **/ if($cfg_delete == 'Y' && $type == 'ON') { $dsql->...= '') { $dsql->ExecuteNoneQuery("Delete From `$addtable` where aid='$aid' "); } if($issystem !...= -1) { $dsql->ExecuteNoneQuery("Delete From `dede_archives` where id='$aid' "); } $dsql->ExecuteNoneQuery...` where aid='$aid' "); $dsql->ExecuteNoneQuery("Delete From `dede_taglist` where aid='$aid' "); $dsql
; $tags = ''; $query = "Select tag From `tf_taglist` where aid='$aid' "; $dsql->Execute('tag',$query)...; while($row = $dsql->GetArray('tag')) { $tags .= ($tags=='' ?...$row['tag']); } return $tags; } 修改为: //获得某文档的所有tag function GetTags($aid) { global $dsql;...$tags = ''; $query = "Select tag From `dede_taglist` where aid='$aid' "; $dsql->Execute('tag...',$query); while($row = $dsql->GetArray('tag')) { $tags.= ($tags=='' ?
‘dede_archives’ : trim($row[‘maintable’]) ); $dsql->ExecuteNoneQuery(“Update `dede_arctiny`...set arcrank=’0′ where id=’$aid’ “); if($row[‘issystem’]==-1) { $dsql...addtable’]).”` set arcrank=’0′ where aid=’$aid’ “); } else { $dsql...newdate’,arcrank=’0′ where id=’$aid’ “); if($row[‘issystem’]==-1) { $dsql...senddate=’$newdate’,arcrank=’0′ where aid=’$aid’ “); } else { $dsql
几乎可以说没有什么不能调用的了 首先把上面代码放到 include/extend.func.php 里 使用方法: function table($table, $field, $id) { global $dsql...$table:str_replace('dede_','cn_',$table)):$table; $dsql -> Execute("me","SHOW COLUMNS FROM `$table`"...); while ($r = $dsql->GetArray()) { if($r['Key'] == 'PRI') $primarys[] = $r['Field']; } if(!...emptyempty($primarys)) { $primary = $primarys[0]; $result = $dsql -> GetOne("SELECT `$field` FROM
FormatJson($ret); return $readData; } function Readmlist($id,$page,$size) { global $dsql...*) as dd FROM sea_comment WHERE m_type=$type AND v_id=$id ORDER BY id DESC"; $rs = $dsql...,$size "; $dsql->setQuery($sql); $dsql->Execute('commentmlist');...while($row=$dsql->GetArray('commentmlist')) { $row['reply']....->setQuery($sql); $dsql->Execute('commentrlist'); while($row=$dsql->GetArray('commentrlist
php $dsql->SetQuery("Select id,typename From `dede_channeltype` where id in(1,2,17) order by id asc "...); $dsql->Execute(); while($row = $dsql->GetObject()) { echo "id}'>{$row->typename
function_exists(‘GetParentTypename’)) { function GetParentTypename(id){ global dsql ; reid...= dsql->GetOne(“SELECT reid FROM xy_arctype where id=id”); reid = reid[‘reid’]; if(empty(reid)...){ //当前栏目不存在父级id,查询当前栏目名称 row1 = dsql->GetOne(“SELECT typename FROM xy_arctype where id=id”); ...return row1[‘typename’]; }else{//当前栏目存在父级id,查询父级栏目名称 row1 = dsql->GetOne(“SELECT typename FROM
,$size "; $dsql->setQuery($sql); $dsql->Execute('commentmlist' ); while($row=...->setQuery($sql); $dsql->Execute('commentrlist'); while($row=$dsql->GetArray('commentrlist'))...,$size "; $dsql->setQuery($sql); $dsql->Execute('commentmlist' ); while($row=...->setQuery($sql); $dsql->Execute('commentrlist'); while($row=$dsql->GetArray('commentrlist'))...$dsql->isClose = false; } if(!
; if($dsql->isClose) { $this->Open(false); $dsql->isClose = false...$id.")"); $dsql->Execute("delcommentcache"); while($row = $dsql->GetArray("delcommentcache"))...; self::$i++; if($dsql->isClose) { $this->Open(false); $dsql...::$i++; if($dsql->isClose) { $this->Open(false); $dsql->isClose =...sql); $cid = $dsql->GetLastID(); if (!
egroups as $egroup) 在它上面加入: if($egroup == 'nativeplace' || $egroups['nativeplace'] == 'nativeplace'){$dsql...->SetQuery("SELECT id,evalue FROM `dede_sys_enum` WHERE egroup='nativeplace'");$dsql->Execute();while...($row = $dsql->GetArray()){$res[]= $row;}foreach($res as $k=>$v){if(preg_match("#([0-9]{1,}).([0-9]{1...$v['id'];$dsql->ExecuteNoneQuery($sql);}}} 最后在后台-联动类别管理-更新一下【地区】的更新缓存即可。
function_exists('GetTopTypename')) { function GetTopTypename($id) { global $dsql;...$row = $dsql->GetOne("SELECT typename,topid FROM #@__arctype WHERE id= $id"); if ($row['topid...{ return $row['typename']; } else { $row1 = $dsql
; function lib_adminname(&$ctag, &$refObj) { global $dsql; if(empty($refObj->Fields['dutyadmin']...)) { $dutyadmin = $GLOBALS['cfg_df_dutyadmin']; } else { $row = $dsql->GetOne("Select dutyadmin
function_exists('getTopChannelName')) { function getTopChannelName($id) { global $dsql; $typeinfo...= $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='{$id}'"); if($typeinfo['reid']==0) return...function_exists('getTopChannelUrl')) { function getTopChannelUrl($id) { global $dsql; $typeinfo...= $dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id='{$id}'"); if($typeinfo['reid']==0) return
Druid还提供了命令行查询sql 可以运行bin/dsql进行操作 Welcome to dsql, the command-line client for Druid SQL....Type "\h" for help. dsql> 提交sql dsql> SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE "__time" BETWEEN...也可以在dsql里操作 dsql> EXPLAIN PLAN FOR SELECT page, COUNT(*) AS Edits FROM wikipedia WHERE "__time" BETWEEN
dede:arclist addfields='zjid' row='1' channelid='24' } [field:zjid runphp="yes"] global $dsql...dede_archives left JOIN dede_addon24 ON dede_archives.id=dede_addon24.aid WHERE dede_archives.typeid=@me"; $dsql...->SetQuery($sql); $dsql->Execute(); @me=""; while($row = $dsql->GetArray()){ @me.
&size=middle'; $dsql->ExecuteNoneQuery("UPDATE `#@__member` SET `face`='"...._scores where integralfields['scores']} order by integral desc"; $scrow = $dsql...; $egroups = array(); if($egroup=='') { $dsql->SetQuery("SELECT egroup FROM `#@__sys_enum...` GROUP BY egroup "); } else { $dsql->SetQuery("SELECT egroup FROM `#@__sys_enum` WHERE...egroup='$egroup' GROUP BY egroup "); } $dsql->Execute('enum'); while($nrow = $dsql->GetArray
领取专属 10元无门槛券
手把手带您无忧上云