本文整理汇总了PHP中DedeSql::GetArray方法的典型用法代码示例。如果您正苦于以下问题:PHP DedeSql::GetArray方法的具体用法?PHP DedeSql::GetArray怎么用?PHP DedeSql::GetArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DedeSql
的用法示例。
在下文中一共展示了DedeSql::GetArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowMsg
exit;
}
$savesql->ExecuteNoneQuery("Update #@__config set `config_value`='{$v}' where `config_name`='{$k}' ");
}
$savesql->SetQuery("Select `config_name`,`config_value` From `#@__config` order by `id` asc");
$savesql->Execute();
if ($savesql->GetTotalRow() <= 0) {
$savesql->Close();
ShowMsg("成功保存变量但从数据库读取所有数据时失败,无法更新配置文件!", "javascript:;");
exit;
}
@copy($configfile, $configfile_bak);
$fp = @fopen($configfile, 'w');
@flock($fp, 3);
@fwrite($fp, "<" . "?php\r\n") or die("配置文件'{$configfile}'不支持写入,本次操作无效!<a href='system_basic.php'>返回</a>");
while ($row = $savesql->GetArray()) {
$row['value'] = str_replace("'", "\\'", $row['config_value']);
fwrite($fp, "\${$row['config_name']} = '" . $row['config_value'] . "';\r\n");
}
fwrite($fp, "?>");
fclose($fp);
$message = "成功修改了系统配置文件config_base.php";
$logindate = getdatetimemk(time());
$loginip = getip();
$username = str_replace($cfg_cookie_encode, '', $_COOKIE["VioomaUserID"]);
$savesql->Close();
WriteNote($message, $logindate, $loginip, $username);
ShowMsg("成功更改系统配置!", "system_basic.php");
exit;
}
?>
示例2: TjCount
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_Data');
//获取系统存在的表信息
$otherTables = Array();
$dedeSysTables = Array();
$channelTables = Array();
$dsql = new DedeSql(false);
$dsql->SetQuery("Select addtable From #@__channeltype");
$dsql->Execute();
while($row = $dsql->GetObject()){
$channelTables[] = $row->addtable;
}
$dsql->SetQuery("Show Tables");
$dsql->Execute('t');
while($row = $dsql->GetArray('t')){
if(ereg("^{$cfg_dbprefix}",$row[0])||in_array($row[0],$channelTables))
{ $dedeSysTables[] = $row[0]; }
else{ $otherTables[] = $row[0]; }
}
function TjCount($tbname,$dsql){
$row = $dsql->GetOne("Select count(*) as dd From $tbname");
return $row['dd'];
}
$mysql_version = $dsql->GetVersion();
$mysql_versions = explode(".",trim($mysql_version));
$mysql_version = $mysql_versions[0].".".$mysql_versions[1];
示例3: __makeAll
fwrite($fp,$row['body']);
fclose($fp);
}
$dsql->Close();
ShowMsg("成功更新一个页面!",$fileurl);
exit();
}
/*----------------------
function __makeAll();
-------------------*/
else if($dopost=="makeall")
{
require_once(dirname(__FILE__)."/../include/inc_arcpart_view.php");
$dsql->ExecuteNoneQuery("update #@__sgpage set uptime='".time()."'");
$row = $dsql->Execute('meoutside',"Select * From #@__sgpage ");
while($row = $dsql->GetArray('meoutside'))
{
$fileurl = $cfg_cmspath."/".$row['filename'];
$filename = $cfg_basedir.$cfg_cmspath."/".$row['filename'];
if($row['ismake']==1)
{
$pv = new PartView();
$pv->SetTemplet($row['body'],"string");
$pv->SaveToHtml($filename);
}
else
{
$fp = fopen($filename,"w") or die("创建:{$filename} 失败,可能是没有权限!");
fwrite($fp,$row['body']);
fclose($fp);
}
示例4: DedeSql
<tr bgcolor="#FFFFFF">
<td colspan="2" align="center" class="mma">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<?php
if(!isset($dsql) || !is_object($dsql)){
$dsql = new DedeSql(false);
}
$addQuery = "";
if(!empty($channelid)){
$channelid = ereg_replace("[^0-9]","",$channelid);
$addQuery = " And channelid='$channelid' ";
}
$userNumID = ereg_replace("[^0-9]","",$userNumID);
$dsql->SetQuery("Select * From #@__member_arctype where memberid='$userNumID' $addQuery order by rank desc; ");
$dsql->Execute();
while($menurow = $dsql->GetArray())
{
if($menurow['channelid']==1) $tf = '<img src="img/dd/exe.gif" width="16" height="16">';
else $tf='<img src="img/dd/image.gif" width="16" height="16">';
?>
<tr>
<td align="right" class="mmbb" height="24" width="30%" style="padding-right:6px"><?php echo $tf?></td>
<td class="mmbb">
<a href='member_archives.php?uid=<?php echo $uid?>&channelid=<?php echo $menurow['channelid']?>&mtype=<?php echo $menurow['aid']?>'><?php echo $menurow['typename']?></a>
</td>
</tr>
<?php
}
?>
</table>
</td>
示例5: int
}
//检测数据库是否存在附加表,不存在则新建一个
$tabsql = "CREATE TABLE IF NOT EXISTS `{$row['addtable']}`( `aid` int(11) NOT NULL default '0',\r\n `typeid` int(11) NOT NULL default '0',\r\n ";
if($mysql_version < 4.1)
$tabsql .= " PRIMARY KEY (`aid`), KEY `".$trueTable."_index` (`typeid`)\r\n) TYPE=MyISAM; ";
else
$tabsql .= " PRIMARY KEY (`aid`), KEY `".$trueTable."_index` (`typeid`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; ";
$dsql->ExecuteNoneQuery($tabsql);
//检测附加表里含有的字段
$fields = array();
$rs = $dsql->SetQuery("show fields from `{$row['addtable']}`");
$dsql->Execute('a');
while($nrow = $dsql->GetArray('a',MYSQL_ASSOC)){
$fields[ strtolower($nrow['Field']) ] = $nrow['Type'];
}
//修改字段配置信息
$dfvalue = $vdefault;
$isnull = ($isnull==1 ? "true" : "false");
$mxlen = $maxlength;
$fieldname = strtolower($fname);
//检测被修改的字段类型,并更新数据表
$fieldinfos = GetFieldMake($dtype,$fieldname,$dfvalue,$mxlen);
$ntabsql = $fieldinfos[0];
$buideType = $fieldinfos[1];
示例6: if
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('sys_Data');
if(empty($dopost)) $dopost = "";
AjaxHead();
$dsql = new DedeSql(false);
echo "<a href='#' onclick='javascript:HideObj(\"_mydatainfo\")'>[<u>关闭</u>]</a>\r\n<xmp>";
if($dopost=="viewinfo") //查看表结构
{
if(empty($tablename)) echo "没有指定表名!";
else{
$dsql->SetQuery("SHOW CREATE TABLE ".$dsql->dbName.".".$tablename);
$dsql->Execute();
$row2 = $dsql->GetArray();
$ctinfo = $row2[1];
echo trim($ctinfo);
}
$dsql->Close();
exit();
}
else if($dopost=="opimize") //优化表
{
if(empty($tablename)) echo "没有指定表名!";
else{
$dsql->ExecuteNoneQuery("OPTIMIZE TABLE `$tablename` ");
$dsql->Close();
echo "执行优化表: $tablename OK!";
}
exit();
}
else if($dopost=="repair") //修复表
示例7: pr_str_replace
function pr_str_replace($str)
{
$dsql = new DedeSql(false);
$dsql->SetQuery("SELECT * FROM `#@__str_replace`");
$dsql->Execute();
while ($row = $dsql->GetArray()) {
if ($row['interconvert'] == 1) {
$str = str_replace($row['find'], "@@@@", $str);
$str = str_replace($row['replace'], $row['find'], $str);
$str = str_replace("@@@@", $row['replace'], $str);
} else {
if ($row['interconvert'] == 0) {
$str = str_replace($row['find'], $row['replace'], $str);
}
}
}
return $str;
}
示例8: _4_MakeCatalog
//更新栏目
/*-------------------
function _4_MakeCatalog()
--------------------*/
else if($step==4)
{
$dsql = new DedeSql(false);
$mkvalue = intval($mkvalue);
$typeids = array();
$adminID = $cuserLogin->getUserID();
$mkcachefile = DEDEADMIN."/../data/mkall_cache_{$adminID}.php";
if($mkvalue<=0)
{
$dsql->SetQuery("Select ID From `#@__arctype` ");
$dsql->Execute();
while($row = $dsql->GetArray()) $typeids[] = $row['ID'];
}else
{
if($uptype=='time') $query = "Select typeid From `#@__full_search` where uptime>='{$mkvalue}' group by typeid";
else $query = "Select typeid From `#@__full_search` where aid>='{$mkvalue}' group by typeid";
$dsql->SetQuery($query);
$dsql->Execute();
while($row = $dsql->GetArray()){
if(!isset($typeids[$row['typeid']])) $typeids[$row['typeid']] = 1;
}
foreach($typeids as $v){
$vs = SpGetTopIDS($v);
foreach($vs as $vv){ if(!isset($typeids[$vv])) $typeids[$row[$vv]] = 1; }
}
}
$fp = fopen($mkcachefile,'w') or die("无法写入缓存文件:{$mkcachefile} 所以无法更新栏目!");
示例9: Values
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_regurl','cfg_pp_regurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_loginurl','cfg_pp_loginurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_exiturl','cfg_pp_exiturl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_editsafeurl','cfg_pp_editsafeurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_name','cfg_pp_name'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_indexurl','cfg_pp_indexurl'); ");
$dsql->ExecuteNoneQuery("Insert into #@__syspassport Values('$pp_type','cfg_pp_type'); ");
$dsql->Close();
$fp = fopen(dirname(__FILE__)."/../include/config_passport.php","w") or die("写入文件 ../include/config_passport.php 失败!");
fwrite($fp,'<'.'?php ');
fwrite($fp,"\r\n");
foreach($GLOBALS as $k=>$v){
if(ereg('^pp_',$k)){
$v = str_replace("'","`",stripslashes($v));
fwrite($fp,'$cfg_'.$k." = '".$v."';\r\n");
}
}
fwrite($fp,'?'.'>');
fclose($fp);
ShowMsg("成功更改通行证设置!","sys_passport.php");
exit();
}
$dsql = new DedeSql(false);
$dsql->SetQuery("Select * From #@__syspassport ");
$dsql->Execute();
while($row = $dsql->GetArray()){ $$row['varname'] = $row['value']; }
require_once(dirname(__FILE__)."/templets/sys_passport.htm");
ClearAllLink();
?>
示例10: DedeSql
<?php
require_once(dirname(__FILE__)."/config.php");
$db = new DedeSql(false);
if(empty($action)){
$smalltypes = array();
$sql = "select typename, ID, smalltypes from #@__arctype where smalltypes<>''";
$db->SetQuery($sql);
$db->Execute();
$typesinfo = $types =array();
while($row = $db->GetArray())
{
$row['smalltypes'] = explode(',',$row['smalltypes']);
foreach($row['smalltypes'] as $smalltypeid)
{
$typesinfo[$smalltypeid][] = $row['typename'];
$types[$smalltypeid][] = $row['ID'];
}
}
$sql = "select * from #@__smalltypes order by disorder asc, id asc";
$db->SetQuery($sql);
$db->Execute();
while($smalltype = $db->GetArray())
{
$smalltype['types'] = $smalltype['relatetype'] = '';
if(!empty($typesinfo[$smalltype['id']]) && is_array($typesinfo[$smalltype['id']]))
{
$smalltype['relatetype'] = implode(', ', $typesinfo[$smalltype['id']]);
$smalltype['types'] = urlencode(implode(', ', $types[$smalltype['id']]));
}
$smalltypes[] = $smalltype;
}
示例11: VALUES
$add_icon = ereg_replace("[^0-9]","",$add_icon);
$add_titles = cn_substr($add_titles,15);
$db->ExecuteNoneQuery("INSERT INTO #@__scores(integral,icon,titles,isdefault) VALUES('$integral','$add_icon','$add_titles','$add_isdefault')");
}
foreach($_POST as $rk=>$rv){
if(ereg('-',$rk))
{
$ID = ereg_replace("[^1-9]","",$rk);
$fildes = ereg_replace("[^a-z]","",$rk);
$k = $$rk;
if(empty($k)) $k = 0;
$sql = $fildes."='".$k."'";
$db->ExecuteNoneQuery("UPDATE #@__scores SET ".$sql." WHERE id='{$ID}'");
if(ereg('Ids-',$rk)) {
if($k) $db->ExecuteNoneQuery("DELETE FROM #@__scores WHERE id='$ID'");
}
}
}
}
$Scores = array();
$db->SetQuery("SELECT * FROM #@__scores ORDER BY id ASC");
$db->Execute();
while($rs = $db->GetArray()) array_push ($Scores,$rs);
require_once(dirname(__FILE__)."/templets/member_scores.htm");
$db->Close();
ClearAllLink();
?>
示例12: __save_edit
$msg = "成功删除一个附件!";
$dsql->ExecuteNoneQuery("Delete From #@__uploads where aid='".$aid."'");
}
$dsql->Close();
ShowMsg($msg,$backurl);
exit();
}else{
$ids = explode(',',$ids);
$idquery = "";
foreach($ids as $aid){
if($idquery=="") $idquery .= " where aid='$aid' ";
else $idquery .= " Or aid='$aid' ";
}
$dsql->SetQuery("Select aid,url From #@__uploads $idquery ");
$dsql->Execute();
while($myrow=$dsql->GetArray()){
$truefile = $cfg_basedir.$myrow['url'];
$rs = 0;
if(!file_exists($truefile)||$myrow['url']=="") $rs = 1;
else $rs = @unlink($truefile);
if($rs==1){
$dsql->ExecuteNoneQuery("Delete From #@__uploads where aid='".$myrow['aid']."'");
}
}
$dsql->Close();
ShowMsg('成功删除选定的文件!',$backurl);
exit();
}
}
/*--------------------------------
function __save_edit() //保存更改
示例13: time
require_once(DEDEINC."/arc.partview.class.php");
$timestamp = time();
if(empty($tag))
{
$tag = '';
}
if(empty($action))
{
// 获取所有分类
$arctype_sql = "select id,typename from `#@__arctype` where ispart=2 order by id asc";
$db = new DedeSql();
$db->SetQuery($arctype_sql);
$db->Execute();
$arctype_list = array();
while($arr = $db->GetArray()) $arctype_list[$arr['id']] = $arr['typename'];
$orderby = empty($orderby) ? 'id' : eregi_replace('[^a-z]','',$orderby);
$orderway = isset($orderway) && $orderway == 'asc' ? 'asc' : 'desc';
if(!empty($tag))
{
$where = " where tag like '%$tag%'";
}
else
{
$where = '';
}
$neworderway = ($orderway == 'desc' ? 'asc' : 'desc');
$query = "Select * from `#@__tagindex` left join `#@__tagindex_ex` using(id) $where order by $orderby $orderway";
$dlist = new DataListCP();
$tag = stripslashes($tag);
示例14: if
else if(!empty($channelid))
{
$query = " Select * From #@__channeltype where ID='$channelid'";
$cInfos = $dsql->GetOne($query);
$channelid = $cInfos['ID'];
$addtable = $cInfos['addtable'];
}
//获取小分类
$smalltypes = '';
if(is_array($typeinfo) && !empty($typeinfo['smalltypes']))
{
$sql = "select * from #@__smalltypes where id in($typeinfo[smalltypes]);";
$dsql->SetQuery($sql);
$dsql->Execute();
while($smalltype = $dsql->GetArray()){
$smalltypes .= '<option value="'.$smalltype['id'].'">'.$smalltype['name']."</option>\n";
}
}
//////////////////////地区数据处理s/////////////////////////////
$dsql->SetQuery("select * from #@__area");
$dsql->Execute();
$toparea = $subarea = array();
while($sector = $dsql->GetArray())
{
if($sector['reid'] == 0){
$toparea[] = $sector;
}else{
$subarea[] = $sector;
}
}
示例15: 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();