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


PHP update_db函数代码示例

本文整理汇总了PHP中update_db函数的典型用法代码示例。如果您正苦于以下问题:PHP update_db函数的具体用法?PHP update_db怎么用?PHP update_db使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: dbupdate_run

function dbupdate_run(&$argv, &$argc)
{
    global $a, $db;
    if (is_null($a)) {
        $a = new App();
    }
    if (is_null($db)) {
        @(include ".htconfig.php");
        require_once "include/dba.php";
        $db = new dba($db_host, $db_user, $db_pass, $db_data);
        unset($db_host, $db_user, $db_pass, $db_data);
    }
    load_config('config');
    load_config('system');
    update_db($a);
}
开发者ID:jzacman,项目名称:friendica,代码行数:16,代码来源:dbupdate.php

示例2: update_db

        $Agility = 10;
        $Defense = 10;
        do {
            update_db('Caranille_Levels', array('Level_ID' => $Level, 'Level_Number' => $Level, 'Level_Experience_Required' => $Experience, 'Level_HP' => $HP, 'Level_MP' => $MP, 'Level_Strength' => $Strength, 'Level_Magic' => $Magic, 'Level_Agility' => $Agility, 'Level_Defense' => $Defense));
            $HP += $_POST['HP_Level'];
            $MP += $_POST['MP_Level'];
            $Strength += $_POST['Strength_Level'];
            $Magic += $_POST['Magic_Level'];
            $Agility += $_POST['Agility_Level'];
            $Defense += $_POST['Defense_Level'];
            $Experience += $_POST['Experience_Level'];
            $Level++;
        } while ($Level <= $max['Level_Number']);
        update_db('Caranille_Configuration', array('Configuration_Name' => 'curve-Experience', 'Configuration_Value' => $_POST['Experience_Level']));
        foreach ($array_character_type as $type) {
            update_db('Caranille_Configuration', array('Configuration_Name' => 'curve-' . $type, 'Configuration_Value' => $_POST[$type . '_Level']));
        }
    }
    if (request_confirm('Delete')) {
        delete_db('Caranille_Levels', $_POST);
        $message = 'Le niveau a bien été supprimée';
    }
    if (request_confirm('End_Add')) {
        if (valid_post_db('Caranille_Levels')) {
            insert_db('Caranille_Levels', addslashes_r($_POST));
            $message = 'niveau ajouté';
        } else {
            $message = 'Tous les champs n\'ont pas été remplis';
        }
    }
}
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:31,代码来源:Levels.php

示例3: array

            $message = "แก้ไขลิงค์เรียบร้อยแล้วค่ะ";
            ?>
			<script type="text/javascript">			
			$(document).ready(function() {
				alertPopup('msg3','alert3','<?php 
            echo $message;
            ?>
',0);
			});		
			</script>
			<?php 
            break;
        case 'saveinfo':
            $Table_Name = 'garageinterface';
            $data = array('garageAbout' => $wysiwg_full);
            $sql = update_db($Table_Name, array('garageId=' => $u_garage), $data);
            mysql_query($sql);
            $message = "แก้ไขข้อมูลเกี่ยวกับอู่เรียบร้อยแล้วค่ะ";
            ?>
			<script type="text/javascript">			
			$(document).ready(function() {
				alertPopup('msg3','alert3','<?php 
            echo $message;
            ?>
',0);
			});		
			</script>
			<?php 
            break;
    }
}
开发者ID:poliko6,项目名称:imatt-taxi,代码行数:31,代码来源:banner.1.show.php

示例4: elseif

    include_once 'mana/template_edit.php';
} elseif ($do == 'editsave') {
    $tplid = getGP('tplid', 'P', 'int');
    $title = getGP('title', 'P');
    $typeid = getGP('typeid', 'P');
    $tplkey = getGP('tplkey', 'P');
    if (getGP('tpluser', 'P') != '') {
        $tpluser = getGP('tpluser', 'P');
    } else {
        $tpluser = '0';
    }
    if (getGP('tpladmin', 'P') != '') {
        $tpladmin = getGP('tpladmin', 'P');
    } else {
        $tpladmin = '0';
    }
    $tpladdr = getGP('tpladdr', 'P');
    //主表信息
    $workclass_template = array('title' => $title, 'typeid' => $typeid, 'tplkey' => $tplkey, 'tpluser' => $tpluser, 'tpladmin' => $tpladmin, 'tpladdr' => $tpladdr);
    update_db('workclass_template', $workclass_template, array('tplid' => $tplid));
    //更新表单
    $workclass_from = array('typeid' => $typeid);
    update_db('workclass_from', $workclass_from, array('tplid' => $tplid));
    //更新流程
    $workclass_flow = array('typeid' => $typeid);
    update_db('workclass_flow', $workclass_flow, array('tplid' => $tplid));
    $content = serialize($workclass_template);
    $title = '编辑工作流模板';
    get_logadd($id, $content, $title, 35, $_USER->id);
    show_msg('工作流模板修改成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
}
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_tpl.php

示例5: getGP

     $name = getGP('name', 'P', 'array');
     $content = getGP('content', 'P', 'array');
     foreach ($bid as $id) {
         if ($name[$id] != '') {
             $wage_basis = array('username' => $username[$id], 'name' => $name[$id], 'content' => $content[$id]);
             update_db('wage_basis', $wage_basis, array('bid' => $id));
         }
         //$sqlu = "SELECT tid,name FROM ".DB_TABLEPRE."wage_type order by tnumber asc";
         //$results = $db->query($sqlu);
         //while ($type = $db->fetch_array($results)) {
         foreach ($_CACHE['wage_type'] as $type) {
             $contentdb = getGP('type_' . $type['tid'], 'P', 'array');
             $wdb = $db->fetch_one_array("SELECT did FROM " . DB_TABLEPRE . "wage_data  WHERE type=1 and viewid='" . $id . "' and tid='" . $type['tid'] . "'");
             if ($wdb['did'] != '') {
                 $wage_data = array('content' => $contentdb[$id]);
                 update_db('wage_data', $wage_data, array('viewid' => $id, 'tid' => $type['tid'], 'type' => 1));
             } else {
                 $wage_data = array('viewid' => $id, 'tid' => $type['tid'], 'name' => $type['name'], 'content' => $contentdb[$id], 'type' => 1);
                 insert_db('wage_data', $wage_data);
             }
         }
     }
     show_msg('薪资基础信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
 } elseif (getGP('id', 'G') != '') {
     $db->query("DELETE FROM " . DB_TABLEPRE . "wage_type WHERE tid = '" . getGP('id', 'G') . "'  ");
     $content = getGP('id', 'G');
     $title = '删除薪资项目';
     get_logadd(getGP('id', 'G'), $content, $title, 36, $_USER->id);
     show_msg('薪资项目删除成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
 } else {
     $sql = "SELECT a.*,b.name FROM " . DB_TABLEPRE . "user a," . DB_TABLEPRE . "user_view b where  a.ischeck!=0 and a.id!=1 and a.id=b.uid ORDER BY a.numbers asc";
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_basis.php

示例6: define

	$Id: user_count.php 1209087 2012-01-08 08:58:28Z baiwei.jiang $
*/
define('IN_ADMIN', True);
require_once '../include/common.php';
get_login($_USER->id);
//更新在线数据到数据库中
$blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "online where uid='" . $_USER->id . "'  ");
if ($blog["uid"] != '') {
    $online = array('startdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'enddate' => get_date('Y-m-d H:i:s', PHP_TIME + 600));
    update_db('online', $online, array('uid' => $_USER->id));
} else {
    $online = array('uid' => $_USER->id, 'startdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'enddate' => get_date('Y-m-d H:i:s', PHP_TIME + 600));
    insert_db('online', $online);
}
//更新在线状态
global $db;
$query = $db->query("SELECT * FROM " . DB_TABLEPRE . "online   order by id desc");
while ($row = $db->fetch_array($query)) {
    $uid = $row['uid'];
    if ($row["enddate"] >= get_date('Y-m-d H:i:s', PHP_TIME)) {
        $user = array('online' => 1);
        update_db('user', $user, array('id' => $uid));
    } else {
        $user = array('online' => 0);
        update_db('user', $user, array('id' => $uid));
    }
}
//更新数据后取出当前总在线人数
$blog = $db->fetch_one_array("SELECT COUNT(*) as online FROM " . DB_TABLEPRE . "user WHERE online='1'  ");
echo $blog["online"];
exit;
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:user_count.php

示例7: load_css

<?php

// l'utilisateur peut ajouter un titre pour chaque module different de Caranille -Accueil
$title = "Historique";
$baseline = "vos actes passés";
load_css('corps.css', 'corps');
if (request_confirm('edit-role-play')) {
    if (verifier_token(600, get_link('diary', 'game'), "editor-role-play-" . request_post('Diary_ID'))) {
        update_db('Caranille_Diaries', array('Diary_Description' => request_post('roleplay'), 'Diary_ID' => request_post('Diary_ID')));
    }
}
if (request_confirm('remove-role-play')) {
    if (verifier_token(600, get_link('diary', 'game'), "remover-role-play-" . request_post('Diary_ID'))) {
        delete_db('Caranille_Diaries', array('Diary_ID' => request_post('Diary_ID')));
    }
}
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:16,代码来源:Diary.php

示例8: exit

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
empty($do) && ($do = 'list');
if ($do == 'edit') {
    $id = getGP('id', 'G', 'int');
    $workdate = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "book_type  WHERE id = '{$id}' ");
    include_once 'template/file_type_edit.php';
} elseif ($do == 'save') {
    $savetype = getGP('savetype', 'P');
    $id = getGP('id', 'P', 'int');
    $title = getGP('title', 'P');
    $father = getGP('father', 'P');
    $keyuser = getGP('keyuser', 'P');
    //$uid=$_USER->id;
    $book_type = array('title' => $title, 'father' => $father, 'keyuser' => $keyuser);
    update_db('book_type', $book_type, array('id' => $id));
    $content = serialize($book_type);
    $title = '编辑图书类别';
    get_logadd($id, $content, $title, 22, $_USER->id);
    show_msg('您要处理的信息操作成功!', 'admin.php?ac=file_type&fileurl=' . $fileurl . '');
}
function GET_FILE_PUBLIC_LIST($fatherid = 0, $selid = 0, $layer = 0)
{
    $str = "";
    global $db;
    $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "book_type where father='{$fatherid}'  ORDER BY id Asc  ");
    if (count($query) > 0) {
        for ($i = 0; $i < $layer; $i++) {
            $str .= "├";
        }
        while ($row = $db->fetch_array($query)) {
开发者ID:haogm123,项目名称:ydoa,代码行数:30,代码来源:mod_file_type_edit.php

示例9: print_r

                    $baseline = "compte inconnu";
                }
            } else {
                $baseline = "email invalide";
            }
        } else {
            $baseline = "formulaire incomplet";
        }
    } else {
        $baseline = "formulaire invalide";
    }
}
if (request_confirm('Valid')) {
    $baseline = 'Restitution de votre mot de passe';
    print_r($_RESQUEST);
    if (!empty($_GET)) {
        extract(addslashes_r($_GET));
    }
    if (!empty($_POST)) {
        extract(addslashes_r($_POST));
    }
    $user = get_db('valid_account', $_REQUEST);
    if (!empty($user)) {
        $Password = password_decode($prefixe_salt . $user['Account_Salt'] . $suffixe_salt, $user['Account_Password']);
        $filter = uniqid();
        $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password);
        update_db('Caranille_Accounts', array('Account_ID' => $user['Account_ID'], 'Account_Password' => $pswd, 'Account_Salt' => $filter));
        $user_record = get_db('request_account', $user);
        valid_renew_email($user_record);
    }
}
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:31,代码来源:Renew.php

示例10: getGP

if ($do == 'list') {
    $id = getGP('id', 'G', 'int');
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "office_goods  WHERE id = '{$id}'  ");
    include_once 'template/edit.php';
} elseif ($do == 'save') {
    $savetype = getGP('savetype', 'P');
    $id = getGP('id', 'P', 'int');
    $goods_type = getGP('goods_type', 'P');
    $title = getGP('title', 'P');
    $specification = getGP('specification', 'P');
    $unit = getGP('unit', 'P');
    $price = getGP('price', 'P');
    $number = getGP('number', 'P');
    $content = getGP('content', 'P');
    $office_goods = array('goods_type' => $goods_type, 'title' => $title, 'specification' => $specification, 'unit' => $unit, 'price' => $price, 'number' => $number, 'content' => $content);
    update_db('office_goods', $office_goods, array('id' => $id));
    $content = serialize($office_goods);
    $title = '编辑办公用品信息';
    get_logadd($id, $content, $title, 23, $_USER->id);
    show_msg('您要处理的信息操作成功!', 'admin.php?ac=index&fileurl=' . $fileurl . '');
}
//读取部门
function GET_FILE_PUBLIC_LIST($fatherid = 0, $selid = 0, $layer = 0)
{
    $str = "";
    global $db;
    $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "goods_type where father='{$fatherid}'   ORDER BY id Asc  ");
    if (count($query) > 0) {
        for ($i = 0; $i < $layer; $i++) {
            $str .= "├";
        }
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_edit.php

示例11: elseif

} elseif ($do == 'add') {
    if ($_POST['view'] != '') {
        $id = getGP('id', 'P', 'int');
        if ($id != '') {
            $title = check_str(getGP('title', 'P'));
            $content = getGP('content', 'P');
            $startdate = getGP('startdate', 'P') . " " . getGP('starth', 'P') . ":" . getGP('starti', 'P') . ":00";
            $enddate = getGP('enddate', 'P') . " " . getGP('endh', 'P') . ":" . getGP('endi', 'P') . ":00";
            $otype = getGP('otype', 'P');
            $department = getGP('department', 'P');
            $participation = getGP('participation', 'P');
            $person = getGP('person', 'P');
            $note = check_str(getGP('note', 'P'));
            $type = getGP('type', 'P');
            $plan = array('title' => $title, 'content' => $content, 'startdate' => $startdate, 'enddate' => $enddate, 'otype' => $otype, 'department' => $department, 'participation' => $participation, 'person' => $person, 'note' => $note, 'type' => $type);
            update_db('plan', $plan, array('id' => $id));
            if (getGP('sms_info_box_person', 'P') != '') {
                $content = '您有一个计划需要执行,计划主题为:' . $title . ';请进行处理!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击查看>></a>';
                SMS_ADD_POST($person, $content, 0, 0, $_USER->id);
            }
            if (getGP('sms_phone_box_person', 'P') != '') {
                $content = '您有一个计划需要执行,请登录OA进行处理!';
                PHONE_ADD_POST(getGP('personphone', 'P'), $content, $person, 0, 0, $_USER->id);
            }
            //////////////////////////////////////////////////
            if (getGP('sms_info_box_participation', 'P') != '') {
                $content = '您有一个计划需要参与,计划主题为:' . $title . ';请进行处理!<a href="admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=views&id=' . $id . '">点击查看>></a>';
                SMS_ADD_POST($participation, $content, 0, 0, $_USER->id);
            }
            //手机短信
            if (getGP('sms_phone_box_participation', 'P') != '') {
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_plan.php

示例12: while

     while ($row = $db->fetch_array($query)) {
         if ($row['inputtype'] == '4') {
             $inputvalues = '';
             $inputvalue = getGP('' . $row["inputname"] . '', 'P', 'array');
             foreach ($inputvalue as $arrsave) {
                 $inputvalues .= $arrsave . ',';
             }
             $inputvalue = substr($inputvalues, 0, -1);
         } elseif ($row['inputtype'] == '2') {
             $inputvalue = trim(getGP('' . $row["inputname"] . '', 'P'));
         } else {
             $inputvalue = check_str(getGP('' . $row["inputname"] . '', 'P'));
         }
         $crm_db = array('content' => $inputvalue);
         //insert_db('crm_db',$crm_db);
         update_db('crm_db', $crm_db, array('viewid' => $vid, 'type' => 'crm_care', 'inputname' => $row["inputname"], 'formid' => $row["fid"]));
         $crm_log .= serialize($crm_db) . '|515158.com|';
     }
     $content = serialize($crm_care);
     $title = get_realname($_USER->id) . '于' . get_date('Y-m-d H:i:s', PHP_TIME) . '编辑客户关怀信息';
     get_logadd($vid, $content, $title, 36, $_USER->id);
     crm_log($title, $vid, $content, substr($crm_log, 0, -12), 1, 'crm_care');
     show_msg('编辑客户关怀信息成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&type=' . getGP('type', 'P'));
 } else {
     $view = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "crm_care  WHERE id = '" . getGP('id', 'G', 'int') . "' ");
     if ($_GET['type'] == '2') {
         get_key("crm_care_edit_2");
     } else {
         get_key("crm_care_edit_1");
     }
     include_once 'company/care_edit.php';
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_care.php

示例13: Services_JSON

$json = new Services_JSON();
include "../../../include/class.mysqldb.php";
include "../../../include/config.inc.php";
include "../../../include/class.function.php";
foreach ($_REQUEST as $key => $value) {
    ${$key} = $value;
    #echo $key ."=". $value."<br>";
}
$model_name = trim($model_name);
$model_name_temp = trim($model_name_temp);
if ($model_name != $model_name_temp) {
    $car_model_chk = select_db('carmodel', "where carModelName = '" . $model_name . "' and carBannerId = '" . $bannerid . "'");
    #print_r($car_model_chk);
    $find_chk = count($car_model_chk);
    if ($find_chk) {
        $data['success'] = false;
        $data['message'] = 'รุ่นรถ "' . $model_name . '" มีแล้วในระบบ';
    } else {
        $TableName = 'carmodel';
        $data = array('carModelName' => $model_name);
        $sql = update_db($TableName, array('carModelId=' => $id), $data);
        //echo $sql;
        mysql_query($sql);
        $data['success'] = true;
        $data['message'] = 'ปรับปรุงรุ่นรถ "' . $model_name_temp . '" เป็น "' . $model_name . '" เรียบร้อยแล้ว';
    }
} else {
    $data['success'] = false;
    $data['message'] = 'รุ่นรถ "' . $model_name . '" ไม่มีการเปลี่ยนแปลง';
}
echo $_GET['callback'] . '(' . $json->encode($data) . ')';
开发者ID:poliko6,项目名称:imatt-taxi,代码行数:31,代码来源:editmodel.php

示例14: get_key

    get_key("istration_conference_type_type");
} elseif ($otype >= '10' && $otype <= '19') {
    get_key("office_type_r");
} else {
}
empty($do) && ($do = 'bbsclass');
if ($do == 'bbsclass') {
    if (getGP('view', 'P') == 'save') {
        $idarr = getGP('id', 'P', 'array');
        $name = getGP('name', 'P', 'array');
        foreach ($idarr as $id) {
            if ($name[$id] == '') {
                $name[$id] = '新' . $_cname['name'];
            }
            $office_type = array('oname' => $name[$id]);
            update_db('office_type', $office_type, array('oid' => $id));
        }
        $newname = '515158';
        foreach (getGP('newname', 'P', 'array') as $name) {
            $newname .= ',,' . $name;
        }
        $newname = explode(',,', str_replace('515158,,', '', $newname));
        if ($newname != '') {
            for ($i = 0; $i < sizeof($newname); $i++) {
                if (str_replace('515158', '', $newname[$i]) != '') {
                    if (str_replace('515158', '', $newname[$i]) == '') {
                        $newname[$i] = '新' . $_cname['name'];
                    }
                    $office_type = array('oname' => str_replace('515158', '', $newname[$i]), 'otype' => $otype, 'uid' => $_USER->id);
                    insert_db('office_type', $office_type);
                }
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_officeclass.php

示例15: create_post_folder

if (isset($_GET["key"]) && isset($_GET["msg"]) && isset($_GET["title"]) && isset($_GET["file"])) {
    $data['success'] = 1;
    $key = $_GET["key"];
    $title = $_GET["title"];
    $file = $_GET["file"];
    create_post_folder($_GET['file']);
    create_post_image(explode(".", $_GET['file'])[0], $_GET['msg']);
    $type = "jokes";
    if (isset($_GET["type"])) {
        $type = $_GET["type"];
    }
    $by = "Miku";
    if (isset($_GET["by"])) {
        $by = $_GET["by"];
    }
    update_db($key, $title, $file, $by, $type);
} else {
    $data['error'] = "Post Id Required";
}
if ($p == 1) {
    echo json_encode($data);
    exit(0);
} else {
    echo "<pre>" . json_encode($data, JSON_PRETTY_PRINT) . "</pre>";
    exit(0);
}
function create_post_folder($file)
{
    global $domain, $data;
    $data['folder-create-info'] = file_get_contents($domain . 'make-post.php?p=1&a=1&post=' . $file);
}
开发者ID:spandey2405,项目名称:mikz,代码行数:31,代码来源:create-post.php


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