本文整理汇总了PHP中mysqld_selectcolumn函数的典型用法代码示例。如果您正苦于以下问题:PHP mysqld_selectcolumn函数的具体用法?PHP mysqld_selectcolumn怎么用?PHP mysqld_selectcolumn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysqld_selectcolumn函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCartTotal
public function getCartTotal()
{
$member = get_member_account(false);
$openid = $member['openid'];
$cartotal = mysqld_selectcolumn("select sum(total) from " . table('shop_cart') . " where session_id='" . $openid . "'");
return empty($cartotal) ? 0 : $cartotal;
}
示例2: in
$condition = $condition . ' and openid in (select alifans.openid from ' . table('alipay_alifans') . ' alifans where alifans.nickname like :alipayname)';
$conditiondata[':alipayname'] = '%' . $_GP['alipayname'] . '%';
}
$status = 1;
if (empty($_GP['showstatus']) || $_GP['showstatus'] == 1) {
$status = 1;
}
if ($_GP['showstatus'] == -1) {
$status = 0;
}
if (!empty($_GP['rank_level'])) {
$rank_model = mysqld_select("SELECT * FROM " . table('rank_model') . "where rank_level=" . intval($_GP['rank_level']));
if (!empty($rank_model['rank_level'])) {
$condition = $condition . " and experience>=" . $rank_model['experience'];
$rank_model2 = mysqld_select("SELECT * FROM " . table('rank_model') . "where rank_level>" . $rank_model['rank_level'] . ' order by rank_level limit 1');
if (!empty($rank_model2['rank_level'])) {
if (intval($rank_model['experience']) < intval($rank_model2['experience'])) {
$condition = $condition . " and experience<" . $rank_model2['experience'];
}
}
}
}
$rank_model_list = mysqld_selectall("SELECT * FROM " . table('rank_model') . " order by rank_level");
$list = mysqld_selectall('SELECT * FROM ' . table('member') . " where 1=1 and `istemplate`=0 and `status`={$status} {$condition} " . " LIMIT " . ($pindex - 1) * $psize . ',' . $psize, $conditiondata);
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('member') . " where 1=1 and `istemplate`=0 {$condition} ", $conditiondata);
$pager = pagination($total, $pindex, $psize);
foreach ($list as $index => $item) {
$list[$index]['weixin'] = mysqld_selectall("SELECT * FROM " . table('weixin_wxfans') . " WHERE openid = :openid", array(':openid' => $item['openid']));
$list[$index]['alipay'] = mysqld_selectall("SELECT * FROM " . table('alipay_alifans') . " WHERE openid = :openid", array(':openid' => $item['openid']));
}
include page('list');
示例3: intval
}
if ($status != '-99') {
$condition .= " AND status = '" . intval($status) . "'";
}
if ($status == '3') {
$condition .= " and ( status = 3 or status = -5 or status = -6)";
}
$dispatchs = mysqld_selectall("SELECT * FROM " . table('shop_dispatch'));
$dispatchdata = array();
if (is_array($dispatchs)) {
foreach ($dispatchs as $disitem) {
$dispatchdata[$disitem['id']] = $disitem;
}
}
$list = mysqld_selectall("SELECT * FROM " . table('shop_order') . " WHERE 1=1 {$condition} ORDER BY createtime DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('shop_order') . " WHERE 1=1 {$condition}");
$pager = pagination($total, $pindex, $psize);
if (!empty($_GP['report'])) {
foreach ($list as $id => $item) {
$list[$id]['ordergoods'] = mysqld_selectall("SELECT (select category.name\tfrom" . table('shop_category') . " category where (0=goods.ccate and category.id=goods.pcate) or (0!=goods.ccate and category.id=goods.ccate) ) as categoryname,goods.thumb,ordersgoods.price,ordersgoods.total,goods.title,ordersgoods.optionname from " . table('shop_order_goods') . " ordersgoods left join " . table('shop_goods') . " goods on goods.id=ordersgoods.goodsid where ordersgoods.orderid=:oid order by ordersgoods.createtime desc ", array(':oid' => $item['id']));
}
$report = 'orderreport';
require_once 'report.php';
exit;
}
include page('order_list');
}
if ($operation == 'detail') {
$orderid = intval($_GP['id']);
$order = mysqld_select("SELECT * FROM " . table('shop_order') . " WHERE id=:id", array(":id" => $orderid));
$payments = mysqld_selectall("SELECT * FROM " . table('payment') . " WHERE enabled = 1");
示例4: message
message('触发关键字' . $_GP['keywords'] . "已存在!");
}
if (!empty($_FILES['thumb']['tmp_name'])) {
file_delete($_GP['thumb_old']);
$upload = file_upload($_FILES['thumb']);
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$thumb = $upload['path'];
}
$data = array('title' => $_GP['title'], 'ruletype' => $_GP['ruletype'], 'keywords' => $_GP['keywords'], 'thumb' => $thumb, 'description' => $_GP['description'], 'url' => $_GP['url']);
mysqld_insert('weixin_rule', $data);
message('保存成功!', 'refresh', 'success');
} else {
if ($rule['keywords'] != $_GP['keywords']) {
$count = mysqld_selectcolumn('SELECT count(id) FROM ' . table('weixin_rule') . " WHERE keywords = :keywords", array(':keywords' => $_GP['keywords']));
if ($count > 0) {
message('触发关键字' . $_GP['keywords'] . "已存在!");
}
}
if (!empty($_FILES['thumb']['tmp_name'])) {
file_delete($_GP['thumb_old']);
$upload = file_upload($_FILES['thumb']);
if (is_error($upload)) {
message($upload['message'], '', 'error');
}
$thumb = $upload['path'];
}
$data = array('title' => $_GP['title'], 'ruletype' => $_GP['ruletype'], 'keywords' => $_GP['keywords'], 'description' => $_GP['description'], 'url' => $_GP['url']);
if (!empty($thumb)) {
$data['thumb'] = $thumb;
示例5: get_member_account
<?php
$member = get_member_account(true, true);
$openid = $member['openid'];
$member = member_get($openid);
$paymentconfig = "";
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')) {
$paymentconfig = " and code!='alipay'";
} else {
if (is_mobile_request()) {
$paymentconfig = " and code!='weixin'";
}
}
$paymentlist = mysqld_selectall("select * from " . table("payment") . " where `enabled`=1 and `code`!='gold' and `online`=1 {$paymentconfig} ");
$paymentscount = mysqld_selectcolumn("select count(id) from " . table("payment") . " where `enabled`=1 and `code`!='gold' and `online`=1 {$paymentconfig} ");
if (empty($paymentscount)) {
message("未找到可用的在线支付方式,暂时不支持余额充值。");
}
if (checksubmit("submit")) {
if (empty($_GP['charge']) || round($_GP['charge'], 2) <= 0) {
message("请输入要充值的金额");
}
$paytypecode = $_GP['paymentcode'];
if (empty($paytypecode)) {
message("请选择充值方式。");
}
$payment = mysqld_select("select * from " . table("payment") . " where `enabled`=1 and `code`=:code and `code`!='gold' and `online`=1", array('code' => $paytypecode));
if (empty($payment['id'])) {
message("未找到付款方式,付款失败");
}
$goodtitle = "余额充值" . $_GP['charge'] . "元";
示例6: array
$condition .= " AND isnew = 1";
$sorturl .= "&isnew=1";
}
if (!empty($_GP['ishot'])) {
$condition .= " AND ishot = 1";
$sorturl .= "&ishot=1";
}
if (!empty($_GP['isdiscount'])) {
$condition .= " AND isdiscount = 1";
$sorturl .= "&isdiscount=1";
}
if (!empty($_GP['istime'])) {
$condition .= " AND istime = 1 ";
$sorturl .= "&istime=1";
}
$children = array();
$category = mysqld_selectall("SELECT * FROM " . table('shop_category') . " WHERE deleted=0 and enabled=1 ORDER BY parentid ASC, displayorder DESC", array(), 'id');
foreach ($category as $index => $row) {
if (!empty($row['parentid'])) {
$children[$row['parentid']][$row['id']] = $row;
unset($category[$index]);
}
}
$list = mysqld_selectall("SELECT * FROM " . table('shop_goods') . " WHERE deleted=0 AND status = '1' {$condition} ORDER BY {$sortfield} ");
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('shop_goods') . " WHERE deleted=0 AND status = '1' {$condition}");
$pager = pagination($total, $pindex, $psize, $url = '', $context = array('before' => 0, 'after' => 0, 'ajaxcallback' => ''));
$id = $profile['id'];
if ($profile['status'] == 0) {
$profile['flag'] = 0;
}
include themePage('goodlist');
示例7: max
exit;
} else {
$pindex = max(1, intval($_GP['page']));
$psize = 20;
$status = intval($_GP['status']);
$where = "openid = '" . $openid . "'";
if ($status == -5) {
$where .= " and ( status=-2 or status=-3 or status=-4 )";
}
if ($status == 99) {
// $where.=" and ( status=-5 or status=-6 or status=3 )";
} else {
$where .= " and status={$status}";
}
$list = mysqld_selectall("SELECT * FROM " . table('shop_order') . " WHERE {$where} ORDER BY id DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize, array(), 'id');
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('shop_order') . " WHERE openid = '" . $openid . "'");
$pager = pagination($total, $pindex, $psize);
if (!empty($list)) {
foreach ($list as &$row) {
$goods = mysqld_selectall("SELECT g.id, g.title, g.thumb, g.marketprice,o.total,o.optionid FROM " . table('shop_order_goods') . " o left join " . table('shop_goods') . " g on o.goodsid=g.id " . " WHERE o.orderid='{$row['id']}'");
foreach ($goods as &$item) {
//属性
$option = mysqld_select("select title,marketprice,weight,stock from " . table("shop_goods_option") . " where id=:id limit 1", array(":id" => $item['optionid']));
if ($option) {
$item['title'] = "[" . $option['title'] . "]" . $item['title'];
$item['marketprice'] = $option['marketprice'];
}
}
unset($item);
$row['goods'] = $goods;
$row['total'] = $goodsid;
示例8: elseif
} elseif ($operation == 'default') {
$id = intval($_GP['id']);
mysqld_update('shop_address', array('isdefault' => 0), array('openid' => $openid));
mysqld_update('shop_address', array('isdefault' => 1), array('id' => $id));
message(1, '', 'ajax');
} elseif ($operation == 'detail') {
$id = intval($_GP['id']);
$row = mysqld_select("SELECT id, realname, mobile, province, city, area, address FROM " . table('shop_address') . " WHERE id = :id", array(':id' => $id));
message($row, '', 'ajax');
} elseif ($operation == 'remove') {
$id = intval($_GP['id']);
if (!empty($id)) {
$address = mysqld_select("select isdefault from " . table('shop_address') . " where id='{$id}' and openid='" . $openid . "' limit 1 ");
if (!empty($address)) {
//修改成不直接删除,而设置deleted=1
mysqld_update("shop_address", array("deleted" => 1, "isdefault" => 0), array('id' => $id, 'openid' => $openid));
if ($address['isdefault'] == 1) {
//如果删除的是默认地址,则设置是新的为默认地址
$maxid = mysqld_selectcolumn("select max(id) as maxid from " . table('shop_address') . " where openid='" . $openid . "' limit 1 ");
if (!empty($maxid)) {
mysqld_update('shop_address', array('isdefault' => 1), array('id' => $maxid, 'openid' => $openid));
die(json_encode(array("result" => 1, "maxid" => $maxid)));
}
}
}
}
die(json_encode(array("result" => 1, "maxid" => 0)));
} else {
$address = mysqld_selectall("SELECT * FROM " . table('shop_address') . " WHERE deleted=0 and openid = :openid", array(':openid' => $openid));
include themePage('address');
}
示例9: round
}
$fee = round($_GP['charge'], 2);
if ($fee > $member['gold']) {
message('账户余额不足,最多能提取' . $member['gold'] . '元');
}
$ordersn = 'rg' . date('Ymd') . random(6, 1);
$gold_order = mysqld_select("SELECT * FROM " . table('gold_teller') . " WHERE ordersn = '{$ordersn}'");
if (!empty($gold_order['ordersn'])) {
$ordersn = 'rg' . date('Ymd') . random(6, 1);
}
member_gold($openid, $fee, 'usegold', '余额提取' . $fee . '元');
mysqld_insert('gold_teller', array('openid' => $openid, 'fee' => $fee, 'status' => 0, 'ordersn' => $ordersn, 'createtime' => time()));
message('余额提取申请成功!', 'refresh', 'success');
exit;
}
$applygold = mysqld_selectcolumn("select sum(fee) from " . table("gold_teller") . " where status=0 and openid=" . $openid);
if (empty($applygold)) {
$applygold = '0';
}
include themePage('outchargegold');
exit;
}
if ($op == 'history') {
$pindex = max(1, intval($_GP['page']));
$psize = 20;
$list = mysqld_selectall("select * from " . table("gold_teller") . " where openid=:openid order by createtime desc LIMIT " . ($pindex - 1) * $psize . ',' . $psize, array(":openid" => $openid));
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('gold_teller') . " where openid=:openid ", array(":openid" => $openid));
$pager = pagination($total, $pindex, $psize);
include themePage('outchargegold_history');
exit;
}
示例10: globaSetting
<?php
$settings = globaSetting();
$advs = mysqld_selectall("select * from " . table('shop_adv') . " where enabled=1 order by displayorder desc");
$allgoods = mysqld_selectcolumn("SELECT count(*) FROM " . table('shop_goods') . " WHERE deleted =0");
$children_category = array();
$category = mysqld_selectall("SELECT *,'' as list FROM " . table('shop_category') . " WHERE isrecommand=1 and enabled=1 and deleted=0 ORDER BY parentid ASC, displayorder DESC", array(), 'id');
foreach ($category as $index => $row) {
if (!empty($row['parentid'])) {
$children_category[$row['parentid']][$row['id']] = $row;
unset($category[$index]);
}
}
$first_good_list = array();
$recommandcategory = array();
foreach ($category as &$c) {
if ($c['isrecommand'] == 1) {
$c['list'] = mysqld_selectall("SELECT * FROM " . table('shop_goods') . " WHERE isrecommand=1 and deleted=0 AND status = 1 and pcate='{$c['id']}' ORDER BY displayorder DESC, sales");
foreach ($c['list'] as &$c1goods) {
if ($c1goods['isrecommand'] == 1 && $c1goods['isfirst'] == 1) {
$first_good_list[] = $c1goods;
}
}
$recommandcategory[] = $c;
}
if (!empty($children_category[$c['id']])) {
foreach ($children_category[$c['id']] as &$child) {
if ($child['isrecommand'] == 1) {
$child['list'] = mysqld_selectall("SELECT * FROM " . table('shop_goods') . " WHERE isrecommand=1 and deleted=0 AND status = 1 and pcate='{$c['id']}' and ccate='{$child['id']}' ORDER BY displayorder DESC, sales DESC ");
foreach ($child['list'] as &$c2goods) {
if ($c2goods['isrecommand'] == 1 && $c2goods['isfirst'] == 1) {
示例11: mysqld_selectall
$condition .= " and t1.realnamestr='" . $realname . "'";
}
if (!empty($_GP['addressname'])) {
$addressname = $_GP['addressname'];
$condition .= " and t1.tdrealname='" . $addressname . "'";
}
if (!empty($_GP['ordersn'])) {
$ordersn = $_GP['ordersn'];
$condition .= " and t1.ordersn='" . $ordersn . "'";
}
if ($isstatus == 1) {
$conditionOrderStatus = "and orders.status>=1";
} else {
$conditionOrderStatus = "and orders.status=3";
}
if (!empty($_GP['orderstatisticsEXP01'])) {
$psize = 9999;
$pindex = 1;
}
$list = mysqld_selectall("select t1.* from (SELECT orders.status,orders.id,orders.createtime,orders.ordersn,orders.price,orders.dispatchprice,orders.paytype,(orders.address_realname ) tdrealname,(concat(orders.address_province,orders.address_city,orders.address_area,orders.address_address) ) tdaddress,(orders.address_mobile ) tdmobile from " . table('shop_order') . " orders where 1=1 {$conditionOrderStatus} order by orders.createtime desc) t1 where 1=1 {$condition} LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
foreach ($list as $id => $displayorder) {
$list[$id]['ordergoods'] = mysqld_selectall("SELECT (select category.name\tfrom" . table('shop_category') . " category where (0=goods.ccate and category.id=goods.pcate) or (0!=goods.ccate and category.id=goods.ccate) ) as categoryname,goods.thumb,ordersgoods.price,ordersgoods.total,goods.title,ordersgoods.optionname from " . table('shop_order_goods') . " ordersgoods left join " . table('shop_goods') . " goods on goods.id=ordersgoods.goodsid where ordersgoods.orderid=:oid order by ordersgoods.createtime desc ", array(':oid' => $list[$id]['id']));
}
$total = mysqld_selectcolumn("select count(t1.id) from (SELECT orders.* from " . table('shop_order') . " orders where 1=1 {$conditionOrderStatus} order by orders.createtime desc) t1 where 1=1 {$condition} ");
$pager = pagination($total, $pindex, $psize);
if (!empty($_GP['orderstatisticsEXP01'])) {
$report = "orderstatistics";
require_once 'report.php';
exit;
}
include addons_page('orderstatistics');
示例12: do_getaward
public function do_getaward()
{
$xc_zjp = mysqld_select("SELECT * FROM " . table('xc_zjp_reply'));
$member = get_member_account(true, intval($xc_zjp['needreg']) == 1);
$openid = $member['openid'];
if (empty($openid)) {
message('非法访问,请重新发送消息进入抽奖页面!');
}
$member = member_get($openid);
if (empty($xc_zjp)) {
message('非法访问,请重新发送消息进入抽奖页面!');
}
$result = array('status' => -1, 'message' => '');
$total = mysqld_selectcolumn("SELECT COUNT(*) FROM " . table('xc_zjp_winner') . " WHERE open_id = '{$openid}' and TO_DAYS(NOW())-TO_DAYS(FROM_UNIXTIME(createtime))<= " . $xc_zjp["periodlottery"]);
$myuser = mysqld_select("SELECT * FROM " . table('xc_zjp_user') . " WHERE open_id = '{$openid}' ");
$friendcount = 0;
$arr_times = $this->get_today_times($total, $xc_zjp['maxlottery'], $friendcount);
$result['useCount'] = false;
$useCredit = false;
if ($arr_times['today_has'] <= 0) {
if (!empty($xc_zjp['basenum']) && $xc_zjp['basenum'] < $member['credit']) {
$useCredit = true;
}
}
if ($arr_times['today_has'] <= 0) {
if (empty($xc_zjp['basenum']) || !empty($xc_zjp['basenum']) && $xc_zjp['basenum'] > $member['credit']) {
$result['nochance'] = $arr_times['today_has'];
$result['message'] = '抽奖机会已用完!';
$vars = array();
$vars['message'] = $result;
$vars['redirect'] = refresh();
$vars['type'] = 'ajax';
exit(json_encode($vars));
}
}
$result['surplusCount'] = $arr_times['today_has'] - 1 < 0 ? -1 : $arr_times['today_has'] - 1;
if (!empty($xc_zjp['basenum'])) {
$result['useCredit1'] = $xc_zjp['basenum'];
$result['surplusCredit1'] = $member['credit'] - $xc_zjp['basenum'] < 0 ? 0 : $member['credit'] - $xc_zjp['basenum'];
} else {
$result['useCredit1'] = 0;
$result['surplusCredit1'] = 0;
}
$result['useCount'] = true;
$gifts = mysqld_selectall("SELECT * FROM " . table('xc_zjp_award') . " WHERE total>0 ORDER BY probalilty ASC");
//计算每个礼物的概率
$probability = 0;
$rate = 1;
$award = array();
foreach ($gifts as $name => $gift) {
if (empty($gift['probalilty'])) {
continue;
}
if ($gift['probalilty'] < 1) {
$temp = explode('.', $gift['probalilty']);
$temp = pow(10, strlen($temp[1]));
$rate = $temp < $rate ? $rate : $temp;
}
$probability = $probability + $gift['probalilty'] * $rate;
$award[] = array('id' => $gift['id'], 'probalilty' => $probability);
}
$all = 100 * $rate;
if ($probability < $all) {
$award[] = array('title' => '', 'probalilty' => $all);
}
mt_srand((double) microtime() * 1000000);
$rand = mt_rand(1, $all);
foreach ($award as $key => $gift) {
if (isset($award[$key - 1])) {
if ($rand > $award[$key - 1]['probalilty'] && $rand <= $gift['probalilty']) {
$awardid = $gift['id'];
break;
}
} else {
if ($rand > 0 && $rand <= $gift['probalilty']) {
$awardid = $gift['id'];
break;
}
}
}
$title = '';
$result['hasPrize'] = false;
$result['message'] = '很遗憾,您没能中奖!';
$data = array('open_id' => $openid, 'status' => 0, 'createtime' => TIMESTAMP);
$credit = array('award' => (empty($awardid) ? '未' : '') . '中奖', 'open_id' => $openid, 'status' => 3, 'description' => empty($awardid) ? $xc_zjp['misscredit'] : $xc_zjp['hitcredit'], 'createtime' => TIMESTAMP);
if (!empty($awardid)) {
$gift = mysqld_select("SELECT * FROM " . table('xc_zjp_award') . " WHERE id = '{$awardid}'");
if ($gift['total'] > 0) {
$data['award'] = $gift['title'];
$result['gift'] = $gift['title'];
$result['giftimg'] = $gift['description'];
$result['hasPrize'] = true;
mysqld_query("UPDATE " . table('xc_zjp_award') . " SET total = total - 1 WHERE id = '{$awardid}'");
$data['description'] = '';
$result['message'] = '恭喜您,得到“' . $data['award'] . '”!' . $desss;
$result['status'] = 0;
} else {
$credit['description'] = $xc_zjp['misscredit'];
}
$data['gifturl'] = $gift['description'];
//.........这里部分代码省略.........
示例13: mysqld_selectall
<?php
$operation = !empty($_GP['op']) ? $_GP['op'] : 'display';
$list = mysqld_selectall("SELECT * FROM " . table('xc_zjp_winner') . " where award <> '' ORDER BY createtime DESC");
foreach ($list as $id => $item) {
$list[$id]['mobile'] = mysqld_selectcolumn("select mobile\tfrom" . table('member') . " where istemplate=0 and openid=:openid ", array(':openid' => $item['open_id']));
}
if ($operation == 'post') {
$id = intval($_GP['id']);
mysqld_update('xc_zjp_winner', array('status' => 2), array('id' => $id));
message('兑现成功!', web_url('awardlist'), 'success');
}
if ($operation == 'delete') {
$id = intval($_GP['id']);
mysqld_delete('xc_zjp_winner', array('id' => $id));
message('删除成功!', web_url('awardlist'), 'success');
}
include addons_page('awardlist');
示例14: max
<?php
$operation = !empty($_GP['op']) ? $_GP['op'] : 'display';
if ($operation == 'display') {
$pindex = max(1, intval($_GP['page']));
$psize = 20;
$condition = '';
$id = intval($_GP['id']);
$list = mysqld_selectall("SELECT comment.*,member.realname,member.mobile,shop_goods.title FROM " . table('shop_goods_comment') . " comment left join " . table('member') . " member on comment.openid=member.openid left join " . table('shop_goods') . " shop_goods on shop_goods.id=comment.goodsid ORDER BY comment.createtime DESC LIMIT " . ($pindex - 1) * $psize . ',' . $psize);
$total = mysqld_selectcolumn('SELECT COUNT(*) FROM ' . table('shop_goods_comment'));
$pager = pagination($total, $pindex, $psize);
include page('goods_comment');
} elseif ($operation == 'delete') {
$id = intval($_GP['id']);
$row = mysqld_select("SELECT * FROM " . table('shop_goods_comment') . " WHERE id = :id", array(':id' => $id));
if (empty($row)) {
message('抱歉,评论不存在或是已经被删除!');
}
//修改成不直接删除,而设置deleted=1
mysqld_delete("shop_goods_comment", array('id' => $id));
message('删除成功!', 'refresh', 'success');
}
示例15: mysqld_selectcolumn
<?php
$requestcount = mysqld_selectcolumn("select count(id) FROM " . table('addon7_request') . " where award_id=:id", array(":id" => intval($_GP['id'])));
if (empty($requestcount)) {
mysqld_delete('addon7_award', array("id" => intval($_GP['id'])));
} else {
mysqld_update('addon7_award', array("deleted" => 1), array("id" => intval($_GP['id'])));
}
message('删除成功!', 'refresh', 'success');