本文整理汇总了PHP中DedeSql::ExecuteNoneQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP DedeSql::ExecuteNoneQuery方法的具体用法?PHP DedeSql::ExecuteNoneQuery怎么用?PHP DedeSql::ExecuteNoneQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DedeSql
的用法示例。
在下文中一共展示了DedeSql::ExecuteNoneQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addslashes
if(empty($emailfield)) $email = '';
else $email = addslashes($row[$emailfield]);
if(empty($sexfield)) $sex = '';
else{
$sex = $row[$sexfield];
if($sex==$sexman) $sex = '男';
else if($sex==$sexwoman) $sex = '女';
else $sex = '';
}
$ntime = time();
$inQuery = "
INSERT INTO #@__member(userid,pwd,uname,sex,birthday,membertype,money,
weight,height,job,province,city,myinfo,tel,oicq,email,homepage,
jointime,joinip,logintime,loginip,showaddr,address)
VALUES ('$userid','$pwd','$uname','$sex','0000-00-00','10','0',
'0','0','','0','0','','','','$email','','$ntime','$loginip','$ntime','','0','');";
$rs = $dsql2->ExecuteNoneQuery($inQuery);
if($rs) $c++;
}
$dsql->Close();
$dsql2->Close();
ShowMsg("成功导入 ".$c." 条数据!","javascript:;");
exit();
}
ClearAllLink();
?>
示例2: time
if (empty($bcatid)) {
$bcatid = 0;
}
if (empty($booktype)) {
$booktype = 0;
}
$addtime = time();
//处理上传的缩略图
if (!isset($isremote)) {
$isremote = 0;
}
$bigpic = UploadOneImage('imgfile', $imgurl, $isremote);
$adminID = $cuserLogin->getUserID();
//----------------------------------
$inQuery = "\n UPDATE `#@__story_content` SET `title`='{$title}',`bookname`='{$bookname}',\n `chapterid`='{$chapterid}',`sortid`='{$sortid}',`bigpic`='{$bigpic}'\n WHERE id='{$cid}'\n";
if (!$dsql->ExecuteNoneQuery($inQuery)) {
ShowMsg("把数据保存到数据库时出错,请检查!" . str_repolace("'", "`", $dsql->GetError() . $inQuery), "-1");
$dsql->Close();
exit;
}
$arcID = $cid;
//生成HTML
//---------------------------------
//$artUrl = MakeArt($arcID,true);
if (empty($artcontentUrl)) {
$artcontentUrl = "";
}
if ($artcontentUrl == "") {
$artcontentUrl = $cfg_mainsite . $cfg_cmspath . "/book/show-photo.php?id={$arcID}&bookid={$bookid}&chapterid={$chapterid}";
}
require_once DEDEROOT . '/book/include/story.view.class.php';
示例3: DedeSql
$voteitems = "";
$j=0;
for($i=1;$i<=15;$i++)
{
if(!empty(${"voteitem".$i})){
$j++;
$voteitems .= "<v:note id=\\'$j\\' count=\\'0\\'>".${"voteitem".$i}."</v:note>\r\n";
}
}
$dsql = new DedeSql(false);
$inQuery = "
insert into #@__vote(votename,starttime,endtime,totalcount,ismore,votenote)
Values('$votename','$starttime','$endtime','0','$ismore','$voteitems');
";
$dsql->SetQuery($inQuery);
if(!$dsql->ExecuteNoneQuery())
{
$dsql->Close();
ShowMsg("增加投票失败,请检查数据是否非法!","-1");
exit();
}
$dsql->Close();
ShowMsg("成功增加一组投票!","vote_main.php");
exit();
}
$startDay = time();
$endDay = AddDay($startDay,30);
$startDay = GetDateTimeMk($startDay);
$endDay = GetDateTimeMk($endDay);
require_once(dirname(__FILE__)."/templets/vote_add.htm");
示例4: checkUser
function checkUser($username,$userpwd)
{
//只允许用户名和密码用0-9,a-z,A-Z,'@','_','.','-'这些字符
$this->userName = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$username);
$this->userPwd = ereg_replace("[^0-9a-zA-Z_@\!\.-]",'',$userpwd);
$pwd = substr(md5($this->userPwd),0,24);
$dsql = new DedeSql(false);
$dsql->SetQuery("Select * From #@__admin where userid='".$this->userName."' limit 0,1");
$dsql->Execute();
$row = $dsql->GetObject();
if(!isset($row->pwd)){
$dsql->Close();
return -1;
}
else if($pwd!=$row->pwd){
$dsql->Close();
return -2;
}
else{
$loginip = GetIP();
$this->userID = $row->ID;
$this->userType = $row->usertype;
$this->userChannel = $row->typeid;
$this->userName = $row->uname;
$groupSet = $dsql->GetOne("Select * From #@__admintype where rank='".$row->usertype."'");
$this->userPurview = $groupSet['purviews'];
$dsql->SetQuery("update #@__admin set loginip='$loginip',logintime='".strftime("%Y-%m-%d %H:%M:%S",time())."' where ID='".$row->ID."'");
$dsql->ExecuteNoneQuery();
$dsql->Close();
return 1;
}
}
示例5: DedeSql
<?php
require(dirname(__FILE__)."/config.php");
CheckPurview('sys_MakeHtml');
$dsql = new DedeSql(false);
$cids = '';
$dsql->SetQuery("Select ID From `#@__channeltype` ");
$dsql->Execute();
while($row = $dsql->GetArray())
{
$cids .= ($cids=='' ? $row[0] : ','.$row[0]);
}
if($cids!='')
{
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__arctype` where NOT (channeltype in ($cids));");
if($rs>0){
$dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__arctype`;");
UpDateCatCache($dsql);
}
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__full_search` where NOT (channeltype in ($cids));");
if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__full_search`;");
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__archives` where NOT (channel in ($cids));");
if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__archives`;");
$rs = $dsql->ExecuteNoneQuery("Delete From `#@__archivesspec` where NOT (channel in ($cids));");
if($rs>0) $dsql->ExecuteNoneQuery("OPTIMIZE TABLE `#@__archivesspec`;");
}
示例6: HexToStr
//--------------------------------------------------------
//签名正确
if ($digest == $signMsg && $mState == 2) {
$OrderInfo = HexToStr($OrderInfo);
if ($newmd5info == $myDigest) {
$dsql = new DedeSql(false);
//获取订单信息,检查订单的有效性
$row = $dsql->GetOne("Select state From #@__shops_orders where oid='{$buyid}' ");
if ($row['state'] > 0) {
$msg = "付款已经完成!,系统返回信息( {$buyid} ) <br><br> <a href='control.php'>返回主页</a> ";
ShowMsg($msg, "javascript:;");
$dsql->Close();
exit;
}
$sql = "UPDATE `#@__shops_orders` SET `state`='1' WHERE `oid`='{$buyid}' AND `userid`='" . $cfg_ml->M_ID . "';";
if ($dsql->ExecuteNoneQuery($sql)) {
$dsql->Close();
ShowMsg("支付成功!", "javascript:;");
exit;
} else {
$dsql->Close();
ShowMsg("支付失败", "javascript:;");
exit;
}
} else {
ShowMsg("交易密钥错误,请与管理员联系!", $burl);
exit;
}
} else {
ShowMsg("交易密钥错误,请与管理员联系!", $burl);
exit;
示例7: CheckPurview
CheckPurview('co_EditNote');
require_once(dirname(__FILE__)."/../include/pub_dedetag.php");
$dtp = new DedeTagParse();
$dbnotes = $notes;
$notes = stripslashes($notes);
$dtp->LoadString($notes);
if(!is_array($dtp->CTags)){
ShowMsg("该规则不合法,无法保存!","-1");
$dsql->Close();
exit();
}
$ctag = $dtp->GetTagByName("item");
$query = "
Update #@__conote
set typeid='".$ctag->GetAtt('typeid')."',
gathername='".$ctag->GetAtt('name')."',
language='".$ctag->GetAtt('language')."',
lasttime=0,
savetime='".time()."',
noteinfo='".$dbnotes."'
where nid = $nid;
";
$dsql = new DedeSql(false);
$rs = $dsql->ExecuteNoneQuery($query);
$dsql->Close();
ShowMsg("成功保存规则!","co_main.php");
exit();
}
ClearAllLink();
?>
示例8: CheckUser
function CheckUser($loginuser,$loginpwd)
{
if(!TestStringSafe($loginuser)||!TestStringSafe($loginpwd))
{
ShowMsg("用户名或密码不合法!","-1");
exit();
}
$loginuser = ereg_replace("[;%'\\\?\*\$]","",$loginuser);
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select ID,pwd From #@__member where userid='$loginuser' ");
if(is_array($row)) //用户存在
{
//密码错误
if($row['pwd'] != $loginpwd){ return -1; }
else{ //成功登录
$dsql->ExecuteNoneQuery("update #@__member set logintime='".time()."',loginip='".GetIP()."' where ID='{$row['ID']}';");
$dsql->Close();
$this->PutLoginInfo($row['ID']);
$this->FushCache();
return 1;
}
}else{ //用户不存在
return 0;
}
}
示例9: if
$dsql->Close();
exit();
}
else if($action=='save')
{
if(!is_array($tasks)){
ShowMsg("你没选择需要操作的任务!","-1");
exit();
}
if(empty($rmpwd)){
ShowMsg("远程管理密码不能为空!","-1");
exit();
}
if(eregi("[^0-9a-z@!]",$rmpwd)){
ShowMsg("远程管理密码只能由 a-z 0-9 ! @ # 几种字符组成!","-1");
exit();
}
if(empty($startid)) $startid = 0;
if(empty($endid)) $endid = 0;
if(empty($typeid)) $typeid = 0;
$dsql->ExecuteNoneQuery("Delete From `#@__task`");
$taskss = '';
if(is_array($tasks)) foreach($tasks as $v) $taskss .= ($taskss=='' ? $v : ','.$v);
$inQuery = "Insert Into `#@__task` ( `id` , `usermtools` , `rmpwd` , `tasks` , `typeid` , `startid` , `endid` , `nodes` , `dotime` , `degree` )
VALUES ('1','$usermtools','$rmpwd','$taskss','$typeid','$startid','$endid','$nodes','$dotime','$degree' ) ;
";
$dsql->ExecuteNoneQuery($inQuery);
ShowMsg("成功更新计划任务配置!","makehtml_task.php");
exit();
}
?>
示例10: int
if($action=='save')
{
if(!isset($fieldtypes[$dtype])){
ClearAllLink();
ShowMsg("你修改的是系统专用类型的数据,禁止操作!","-1");
exit();
}
//检测数据库是否存在附加表,不存在则新建一个
$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);
示例11: UploadOneImage
function UploadOneImage($upname,$handurl='',$ddisremote=1,$ntitle='')
{
global $cuserLogin,$cfg_basedir,$cfg_image_dir,$dsql,$title;
if($ntitle!='') $title = $ntitle;
$ntime = time();
$filename = '';
$isrm_up = false;
$handurl = trim($handurl);
//如果用户自行上传了图片
if(!empty($_FILES[$upname]['tmp_name']) && is_uploaded_file($_FILES[$upname]['tmp_name']))
{
$istype = 0;
$sparr = Array("image/pjpeg","image/jpeg","image/gif","image/png");
$_FILES[$upname]['type'] = strtolower(trim($_FILES[$upname]['type']));
if(!in_array($_FILES[$upname]['type'],$sparr)){
ShowMsg("上传的图片格式错误,请使用JPEG、GIF、PNG格式的其中一种!","-1");
exit();
}
if(!empty($handurl) && !eregi("^http://",$handurl) && file_exists($cfg_basedir.$handurl) ){
if(!is_object($dsql)) $dsql = new DedeSql();
$dsql->ExecuteNoneQuery("Delete From #@__uploads where url like '$handurl' ");
$fullUrl = eregi_replace("\.([a-z]*)$","",$handurl);
}else{
$savepath = $cfg_image_dir."/".strftime("%Y-%m",$ntime);
CreateDir($savepath);
$fullUrl = $savepath."/".strftime("%d",$ntime).dd2char(strftime("%H%M%S",$ntime).'0'.$cuserLogin->getUserID().'0'.mt_rand(1000,9999));
}
if(strtolower($_FILES[$upname]['type'])=="image/gif") $fullUrl = $fullUrl.".gif";
else if(strtolower($_FILES[$upname]['type'])=="image/png") $fullUrl = $fullUrl.".png";
else $fullUrl = $fullUrl.".jpg";
//保存
@move_uploaded_file($_FILES[$upname]['tmp_name'],$cfg_basedir.$fullUrl);
$filename = $fullUrl;
//水印
@WaterImg($imgfile,'up');
$isrm_up = true;
}
//远程或选择本地图片
else{
if($handurl=='') return '';
//远程图片并要求本地化
if($isremote==1 && eregi("^http://",$handurl)){
$ddinfos = GetRemoteImage($handurl,$cuserLogin->getUserID());
if(!is_array($ddinfos)) $litpic = "";
else $filename = $ddinfos[0];
$isrm_up = true;
//本地图片或远程不要求本地化
}else{
$filename = $handurl;
}
}
$imgfile = $cfg_basedir.$filename;
if(is_file($imgfile) && $isrm_up && $filename!=''){
$info = "";
$imginfos = GetImageSize($imgfile,$info);
//把新上传的图片信息保存到媒体文档管理档案中
$inquery = "
INSERT INTO #@__uploads(title,url,mediatype,width,height,playtime,filesize,uptime,adminid,memberid)
VALUES ('$title','$filename','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".time()."','".$cuserLogin->getUserID()."','0');
";
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery($inquery);
}
return $filename;
}
示例12: ShowMsg
uname = '$uname',
sex = '$sex',
mybb = '$mybb',
spacename = '$spacename',
news = '$news'
where ID='$ID'";
$query2 = "update #@__member_perinfo set
uname = '$uname',
sex = '$sex',
birthday = '$birthday',
weight = '$weight',
height = '$height',
job = '$job',
province = '$province',
city = '$city',
myinfo = '$myinfo',
oicq = '$oicq',
tel = '$tel',
homepage = '$homepage',
fullinfo = '$fullinfo',
address = '$address'
where id='$ID'";
$dsql->ExecuteNoneQuery($query1);
$dsql->ExecuteNoneQuery($query2);
$dsql->Close();
ShowMsg("成功更改会员资料!",$ENV_GOBACK_URL);
exit();
}
ClearAllLink();
?>
示例13: DedeSql
<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_SoftConfig');
if(empty($dopost)) $dopost = "";
//保存
$dsql = new DedeSql(false);
$upok = '';
if($dopost=="save")
{
$query = "UPDATE `#@__softconfig` SET downtype = '$downtype' , showlocal = '$showlocal',
gotojump='$gotojump' , ismoresite = '$ismoresite',sites = '$sites'";
$dsql->SetQuery($query);
$dsql->ExecuteNoneQuery();
$upok = "<font color='red'>成功保存更改!</font>";
}
//读取参数
$row = $dsql->GetOne("select * From #@__softconfig");
if(!is_array($row)){
$dsql->ExecuteNoneQuery("INSERT INTO `#@__softconfig` ( `downtype` , `ismoresite` ,`showlocal` , `gotojump` , `sites` ) VALUES ('0', '0','0' , '0', '');");
$row['downtype']=1;
$row['ismoresite']=0;
$row['sites']="";
$row['gotojump']=0;
}
require_once(dirname(__FILE__)."/templets/soft_config.htm");
ClearAllLink();
?>
示例14: if
$dsql->Close();
ShowMsg("操作成功,返回目录...","catalog_main.php");
exit();
}
else if($dopost=="upRankAll")
{
//检查权限许可
CheckPurview('t_Edit');
$dsql = new DedeSql(false);
$row = $dsql->GetOne("Select ID From #@__arctype order by ID desc");
if(is_array($row))
{
$maxID = $row['ID'];
for($i=1;$i<=$maxID;$i++){
if(isset(${'sortrank'.$i})){
$dsql->ExecuteNoneQuery("Update #@__arctype set sortrank='".(${'sortrank'.$i})."' where ID='{$i}';");
}
}
}
$dsql->Close();
ShowMsg("操作成功,正在返回...","catalog_main.php");
exit();
}
/*---------------------
获取JS文件
function GetJs
----------------------*/
else if($dopost=="GetJs")
{
require_once(dirname(__FILE__)."/makehtml_js.php");
exit();
示例15: if
if(empty($tablename)) echo "没有指定表名!";
else{
$dsql->SetQuery("SHOW CREATE TABLE ".$dsql->dbName.".".$tablename);
$dsql->Execute();
$row2 = $dsql->GetArray();
$ctinfo = $row2[1];
echo "<xmp>".trim($ctinfo)."</xmp>";
}
$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") //修复表
{
if(empty($tablename)) echo "没有指定表名!";
else{
$rs = $dsql->ExecuteNoneQuery("REPAIR TABLE `$tablename` ");
$dsql->Close();
echo "修复表: $tablename OK!";
}
exit();
}else if($dopost=="query") //执行SQL语句
{