当前位置: 首页>>代码示例>>PHP>>正文


PHP dbex::exeUpdate方法代码示例

本文整理汇总了PHP中dbex::exeUpdate方法的典型用法代码示例。如果您正苦于以下问题:PHP dbex::exeUpdate方法的具体用法?PHP dbex::exeUpdate怎么用?PHP dbex::exeUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dbex的用法示例。


在下文中一共展示了dbex::exeUpdate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plugins_set_mine

function plugins_set_mine($id, $is_del = 0)
{
    $id = intval($id);
    $is_del = intval($is_del);
    $val = '';
    $uid = get_sess_userid();
    global $tablePreStr;
    $t_users = $tablePreStr . "users";
    $t_plugins = $tablePreStr . "plugins";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $u_apps = get_sess_apps();
    if ($is_del == 0) {
        if ($u_apps == '') {
            $val = $id;
        } else {
            $val = $u_apps . "," . $id;
        }
    } else {
        $val = str_replace(",{$id},", "", ",{$u_apps},");
    }
    $sql = " update {$t_users} set use_apps = '{$val}' where user_id = {$uid} ";
    if ($dbo->exeUpdate($sql)) {
        set_sess_apps($val);
        if ($is_del == 0) {
            $sql = " update {$t_plugins} set use_num=use_num+1 where id={$id} ";
        } else {
            $sql = " update {$t_plugins} set use_num=use_num-1 where id={$id} ";
        }
        return $dbo->exeUpdate($sql);
    } else {
        return 0;
    }
}
开发者ID:omusico,项目名称:Social,代码行数:35,代码来源:plugins_set.php

示例2: code_exists

function code_exists()
{
    $is_admin = '';
    $sendor_id = '';
    $admin_id = get_session('admin_id');
    if ($admin_id) {
        $is_admin = 1;
        $sendor_id = $admin_id;
    } else {
        $user_id = get_sess_userid();
        if (!$user_id) {
            return false;
            exit;
        }
        $is_admin = 0;
        $sendor_id = $user_id;
    }
    if ($sendor_id != '' && $is_admin !== '') {
        global $inviteCodeValue;
        global $tablePreStr;
        global $inviteCodeLength;
        $t_invite_code = $tablePreStr . "invite_code";
        $t_users = $tablePreStr . "users";
        if ($is_admin == 0) {
            $user_info = api_proxy('user_self_by_uid', 'integral', $sendor_id);
            $intg = $user_info['integral'];
            if ($inviteCodeValue > $intg) {
                return false;
            }
        }
        $dbo = new dbex();
        dbplugin('r');
        $invite_code = randkeys($inviteCodeLength);
        $sql = "select id from {$t_invite_code} where code_txt='{$invite_code}'";
        $is_exists = $dbo->getRow($sql);
        if ($is_exists['id']) {
            code_exists();
        } else {
            $time = time();
            $sql = "insert into {$t_invite_code} (sendor_id,code_txt,is_admin,add_time) values({$sendor_id},'{$invite_code}',0,{$time})";
            $success = $dbo->exeUpdate($sql);
            if ($success) {
                if ($is_admin == 0) {
                    $sql = "update {$t_users} set integral=integral-{$inviteCodeValue} where user_id={$sendor_id}";
                    $dbo->exeUpdate($sql);
                }
                return $invite_code;
            } else {
                return false;
            }
        }
    }
}
开发者ID:omusico,项目名称:Social,代码行数:53,代码来源:produce_rand.php

示例3: msgboard_set

function msgboard_set($to_user_id)
{
    global $tablePreStr;
    $dbo = new dbex();
    dbplugin('w');
    $t_message = $tablePreStr . "msgboard";
    $sql = "update {$t_message} set readed=1 where to_user_id='{$to_user_id}'";
    $dbo->exeUpdate($sql);
}
开发者ID:omusico,项目名称:Social,代码行数:9,代码来源:msgboard_set.php

示例4: scrip_send

function scrip_send($sender, $title, $content, $to_id, $scrip_id = '')
{
    global $tablePreStr;
    $uid = get_sess_userid();
    $uico = get_sess_userico();
    $t_scrip = $tablePreStr . "msg_inbox";
    $dbo = new dbex();
    dbplugin('w');
    $sql = "insert into {$t_scrip} (mess_title,mess_content,from_user,from_user_ico,user_id,add_time,from_user_id,mesinit_id)" . "value('{$title}','{$content}','{$sender}','{$uico}',{$to_id},NOW(),{$uid},'{$scrip_id}')";
    return $dbo->exeUpdate($sql);
}
开发者ID:omusico,项目名称:Social,代码行数:11,代码来源:scrip_send.php

示例5: money_set_add_user_money

function money_set_add_user_money($user_id, $consume_point, $exchange_datetime, $exchange_money)
{
    global $tablePreStr;
    $t_money = $tablePreStr . "money";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('w');
    //insert into isns_money (user_id, consume_point, exchange_datetime, exchange_money) value (1, 10, '2015-08-11 15:55:23', 33);
    $sql = "insert into {$t_money} (user_id, consume_point, exchange_datetime, exchange_money) \n\t\t\tvalue ({$user_id}, {$consume_point}, '{$exchange_datetime}', {$exchange_money})";
    $result_rs = $dbo->exeUpdate($sql);
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:12,代码来源:money_set.php

示例6: user_set_update_user_point

function user_set_update_user_point($user_id, $user_point)
{
    global $tablePreStr;
    $t_users = $tablePreStr . "users";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('w');
    //update isns_users set user_point=2000 where user_id=1;
    $sql = "update {$t_users} set user_point={$user_point} where user_id={$user_id}";
    $result_rs = $dbo->exeUpdate($sql);
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:12,代码来源:user_set.php

示例7: paper_add_view_count

function paper_add_view_count($paper_id)
{
    global $tablePreStr;
    $t_papers = $tablePreStr . "papers";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $get_view_count_sql = "select {$t_papers}.view_count from {$t_papers} where {$t_papers}.paper_id={$paper_id}";
    $result_rs = $dbo->getRow($get_view_count_sql);
    $view_count = $result_rs['view_count'];
    $view_count += 1;
    //读写分离定义函数
    dbtarget('w', $dbServs);
    $update_view_count_sql = "update {$t_papers} set {$t_papers}.view_count={$view_count} where {$t_papers}.paper_id={$paper_id}";
    if ($dbo->exeUpdate($update_view_count_sql)) {
        //执行成功返回到我发的纸条界面
        return true;
    }
    return false;
}
开发者ID:omusico,项目名称:Social,代码行数:20,代码来源:paper_get.php

示例8: tag_relation

function tag_relation($mod_id, $tag_id, $content_id, $type = 'add')
{
    global $tablePreStr;
    global $dbo;
    $dbo = new dbex();
    dbplugin('w');
    $table = $tablePreStr . "tag_relation";
    $tag_id = explode(',', $tag_id);
    foreach ($tag_id as $rs) {
        if ($rs != '') {
            if ($type == 'add') {
                $sql = "insert into {$table} (`id`,`mod_id`,`content_id`) values ({$rs},{$mod_id},{$content_id})";
            } else {
                $sql = "delete from {$table} where content_id={$content_id} and id={$tag_id} and mod_id={$mod_id}";
            }
            if (!$dbo->exeUpdate($sql)) {
                return 'error';
                break;
            }
        }
    }
}
开发者ID:omusico,项目名称:Social,代码行数:22,代码来源:ftag.php

示例9:

//insert into isns_papers (user_id, content, picture, create_time) value (1, '纸条内容', '纸条路径', '2015-08-12 15:57:12');
dbplugin('r');
$get_comment_count_sql = "select {$t_papers}.comment_count,{$t_papers}.private_count from {$t_papers} where {$t_papers}.paper_id={$paper_id}";
$result_rs = $dbo->getRow($get_comment_count_sql);
$comment_count = $result_rs['comment_count'];
$private_count = $result_rs['private_count'];
if ($comment_type == 0) {
    $comment_count += 1;
} else {
    $private_count += 1;
}
//读写分离定义函数
dbtarget('w', $dbServs);
/* update isns_papers set isns_papers.comment_count = 3 where isns_papers.paper_id=111114; */
$update_comment_count_sql = "update {$t_papers} set {$t_papers}.comment_count={$comment_count},{$t_papers}.private_count={$private_count} where {$t_papers}.paper_id={$paper_id}";
if ($dbo->exeUpdate($update_comment_count_sql)) {
    //插入纸条评论
    //insert into isns_comments (paper_id, comment_content, commenter_id, comment_time, comment_status, comment_type)
    //value (1111111, "abc", 1, '2015-08-05 22:39:12', 0, 1);
    $sql = "insert into {$t_comments} (paper_id, comment_content, commenter_id, comment_time, comment_status, comment_type) \n\t\tvalue ({$paper_id}, '{$comment_content}', {$commenter_id}, '{$current_time}', 0, {$comment_type})";
    if ($dbo->exeUpdate($sql)) {
        //if(0 == $comment_type)
        //{
        action_return(1, '', 'modules.php?app=paper_show_detail&paper_id=' . $paper_id);
        //}else{
        //action_return(1, '', 'modules.php?app=pick_paper_detail&paper_id='.$paper_id);
        //}
    } else {
        action_return(0, 'error', '-1');
    }
} else {
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:comment_add.action.php

示例10: dbex

$t_subject_comment = $tablePreStr . "group_subject_comment";
$t_mood = $tablePreStr . "mood";
$t_mood_comment = $tablePreStr . "mood_comment";
$dbo = new dbex();
switch ($type_id) {
    case "0":
        $t_table = $t_blog;
        $t_table_com = $t_blog_comment;
        $mod_col = "log_id";
        break;
    case "1":
        $group_info = api_proxy("group_sub_by_sid", "group_id", $com_id);
        $group_id = $group_info['group_id'];
        dbtarget('w', $dbServs);
        $sql = "update {$t_group} set comments=comments-1 where group_id={$group_id}";
        $dbo->exeUpdate($sql);
        $t_table = $t_subject;
        $t_table_com = $t_subject_comment;
        $mod_col = "subject_id";
        break;
    case "2":
        $t_table = $t_album;
        $t_table_com = $t_album_comment;
        $mod_col = "album_id";
        break;
    case "3":
        $t_table = $t_photo;
        $t_table_com = $t_photo_comment;
        $mod_col = "photo_id";
        break;
    case "4":
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:restore_del.action.php

示例11: foreach

 $page = 1;
 $count = 50;
 $since_id = 0;
 $max_id = 0;
 $base_app = 0;
 $trim_user = 0;
 $feature = 1;
 // 0-全部,1-原创,2-图片,3-视频,4-音乐
 $statuses = $c->user_timeline_by_id($uid, $page, $count, $since_id, $max_id, $feature, $trim_user, $base_app);
 if_weiboapi_fail($statuses);
 foreach ($statuses['statuses'] as $status) {
     if ("{$wid}" == $status['idstr']) {
         // wid 是当前用户的原创微博
         // 扣钱先
         $sql = "update user set realtime_money = realtime_money - {$db_total_price} where user_id = '{$_SESSION['uid']}' limit 1";
         $num = $dbo->exeUpdate($sql);
         if (1 != $num) {
             $msg = "扣钱失败,跳转。SQL:" . $sql;
             debug($msg, __FILE__, __LINE__);
         }
         // 扣钱成功,写task表
         $sql = "insert into task (owner_id, publisher_id, type, base_price, amount, status, create_at, expire_in) values('{$_SESSION['uid']}', '{$_SESSION['uid']}', 1, '{$db_base_price}', '{$amount}', 1, now(), '{$expire_in_sec}')";
         $num = $dbo->exeUpdate($sql);
         if (1 != $num) {
             // 写数据表失败,回滚金钱数据
             $sql2 = "update user set realtime_money=realtime_money + {$db_total_price} where user_id = '{$_SESSION['uid']}' limit 1";
             $num2 = $dbo->exeUpdate($sql2);
             if (1 != $num2) {
                 $msg = "回滚金钱数据失败,这个比较糟糕。SQL:" . $sql2;
                 debug($msg, __FILE__, __LINE__);
             }
开发者ID:mafergomez70,项目名称:micro-power,代码行数:31,代码来源:create_task.php

示例12: join

//读写分离定义函数
dbtarget('r', $dbServs);
//删除blog内部的图片
$blog_content = api_proxy("blog_self_by_bid", "log_content", $ulog_id);
$blog_content = $blog_content['log_content'];
preg_match_all("/classId=\"\\d\"/", $blog_content, $match);
$match = preg_replace("/[classId=,\"]/", '', $match[0]);
if (!empty($match)) {
    $match = join(",", $match);
    $sql = "select file_src from {$t_uploadfile} where id in ({$match})";
    $file_src = $dbo->getRs($sql);
    foreach ($file_src as $rs) {
        unlink($rs['file_src']);
    }
}
//定义写操作
dbtarget('w', $dbServs);
if (!empty($match)) {
    $sql = "delete from {$t_uploadfile} where id in ({$match})";
    $dbo->exeUpdate($sql);
}
$sql = "delete from {$t_blog} where log_id={$ulog_id} and user_id={$user_id}";
if ($dbo->exeUpdate($sql) && mysql_affected_rows() > 0) {
    $sql = "delete from {$t_blog_comments} where log_id={$ulog_id}";
    $dbo->exeUpdate($sql);
    increase_integral($dbo, $int_del_blog, $user_id);
    del_affair($dbo, 0, $ulog_id);
    action_return(1, '', 'modules.php?app=blog_list');
} else {
    action_return(0, $b_langpackage->b_del_false);
}
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:blog_del.action.php

示例13: intval

$give_point = intval(get_argp('give_point'));
$user_id = get_sess_userid();
$dbo = new dbex();
//增加评论数
//insert into isns_papers (user_id, content, picture, create_time) value (1, '纸条内容', '纸条路径', '2015-08-12 15:57:12');
dbplugin('r');
$check_sql = "select * from {$t_papers} where {$t_papers}.paper_id={$paper_id} and {$t_papers}.user_id={$user_id}";
$result_rs = $dbo->getRow($check_sql);
if (empty($result_rs)) {
    action_return(0, 'error', '-1');
}
//读写分离定义函数
dbtarget('w', $dbServs);
/* update isns_papers set isns_papers.paper_status = 1 where isns_papers.paper_id=111114; */
$update_paper_status_sql = "update {$t_papers} set {$t_papers}.paper_status=1 where {$t_papers}.paper_id={$paper_id}";
$result_rs = $dbo->exeUpdate($update_paper_status_sql);
$update_comment_money_sql = "update {$t_comments} set comment_money = {$give_point} where paper_id = {$paper_id} and comment_status = 1";
$dbo->exeUpdate($update_comment_money_sql);
if ($result_rs) {
    dbplugin('r');
    $query_receiver_point_sql = "select {$t_users}.user_point from {$t_users} where {$t_users}.user_id={$point_receiver_id}";
    $result_rs = $dbo->getRow($query_receiver_point_sql);
    if (empty($result_rs)) {
        action_return(0, 'error', '-2');
    }
    $receiver_point = $result_rs['user_point'];
    $receiver_point += $give_point;
    dbtarget('w', $dbServs);
    //插入纸条评论
    $add_user_point_sql = "update {$t_users} set {$t_users}.user_point={$receiver_point} where {$t_users}.user_id={$point_receiver_id}";
    if ($dbo->exeUpdate($add_user_point_sql)) {
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:paper_bless_add.action.php

示例14: in

foreach ($cho as $v) {
    $option .= "," . $v;
}
$sql = "select `option` from {$t_polloption} where oid in(0.{$option})";
$option_rs = $dbo->getRs($sql);
$cho_str = '';
foreach ($option_rs as $val) {
    $cho_str .= "\"" . $val['option'] . "\",";
}
//定义写操作
dbtarget('w', $dbServs);
foreach ($cho as $value) {
    if (short_check($value) != '') {
        $cho_value = short_check($value);
        $sql = "update {$t_polloption} set votenum=votenum+1 where oid={$cho_value}";
        $dbo->exeUpdate($sql);
    }
}
//加分过程
if (!empty($total_credit) && !empty($per_int)) {
    if ($total_credit <= $per_int) {
        $per_int = $total_credit;
        $sql = "update {$t_poll} set credit = 0 , percredit = 0 where p_id={$pid}";
        $dbo->exeUpdate($sql);
    } else {
        $sql = "update {$t_poll} set credit=credit-{$per_int} where p_id={$pid}";
        $dbo->exeUpdate($sql);
    }
    $sql = "update {$t_users} set integral=integral+{$per_int} where user_id={$user_id}";
    $is_suc = $dbo->exeUpdate($sql);
}
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:poll_submit.action.php

示例15: privacylp

<?php

//引入语言包
$pr_langpackage = new privacylp();
//变量获得
$user_id = get_sess_userid();
$input_mess_para = short_check(get_argp('input_mess'));
//数据表定义区
$t_users = $tablePreStr . "users";
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
$sql = "update {$t_users} set inputmess_limit={$input_mess_para} where user_id={$user_id}";
$dbo->exeUpdate($sql);
action_return(1, $pr_langpackage->pr_save_sec, "modules.php?app=pr_inputmess");
开发者ID:omusico,项目名称:Social,代码行数:15,代码来源:home_inputmess_set.action.php


注:本文中的dbex::exeUpdate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。