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


PHP insert_db函数代码示例

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


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

示例1: workbench_registadd

function workbench_registadd($rid, $hour, $number, $type)
{
    global $_USER;
    $registration_log = array('rid' => $rid, 'hour' => $hour, 'number' => $number, 'type' => $type);
    insert_db('registration_log', $registration_log);
    return;
}
开发者ID:haogm123,项目名称:ydoa,代码行数:7,代码来源:function_workbench.php

示例2: config_user

 public function config_user()
 {
     global $db;
     $user = array('username' => 'CRMUSER', 'password' => '96e79218965eb72c92a549dd5a330112', 'groupid' => '1', 'ischeck' => '1');
     insert_db('user', $user);
     $id = $db->insert_id();
     $user_view = array('name' => 'CRMUSER');
     insert_db('user_view', $user_view);
 }
开发者ID:haogm123,项目名称:ydoa,代码行数:9,代码来源:class_config.php

示例3: news_comment_record

 function news_comment_record($News)
 {
     if (verif_connect(true)) {
         if (verifier_token(600, get_link('Comments', 'Public'), 'Comment-' . $News['News_ID'])) {
             if (request_confirm('End_Add')) {
                 if (request_confirm('Comment_Message')) {
                     insert_db('Caranille_Comments', addslashes_r($_POST));
                 }
             }
         }
     }
 }
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:12,代码来源:Comments.php

示例4: register_request

function register_request()
{
    global $prefixe_salt, $suffixe_salt;
    extract(addslashes_r(stripslashes_r($_POST)));
    $Date = date('Y-m-d H:i:s');
    $IP = getRealIpAddr();
    $filter = uniqid();
    $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password);
    $key = uniqid();
    insert_db('Caranille_Accounts', array('Account_Pseudo' => strip_tags($Pseudo), 'Account_Password' => strip_tags($pswd), 'Account_Salt' => $filter, 'Account_Email' => $Email, 'Account_Sexe' => $Sexe, 'Account_Inscription' => $Date, 'Account_Last_IP' => $IP, 'Account_HP_Remaining' => 100, 'Account_Key' => $key, 'Account_valid' => 0, 'Account_Level' => 1, 'Account_Order' => 1, 'Account_Reason' => 'None', 'Account_Status' => "Authorized", 'Account_Access' => "Member", 'Account_Guild_ID' => 0, 'Account_HP_Bonus' => 0, 'Account_MP_Remaining' => 10, 'Account_MP_Bonus' => 0, 'Account_Strength_Bonus' => 0, 'Account_Magic_Bonus' => 0, 'Account_Agility_Bonus' => 0, 'Account_Defense_Bonus' => 0, 'Account_Experience' => 0, 'Account_Golds' => 0, 'Account_Notoriety' => 0, 'Account_Chapter' => 1, 'Account_Mission' => 1, 'Account_Step' => 2));
    $user_record = get_db('request_account', $_POST);
    return $user_record;
}
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:13,代码来源:Register.php

示例5: PHONE_ADD_POST

function PHONE_ADD_POST($person = 0, $content = 0, $receiveperson = 0, $type = 0, $url = 0, $userid = 0)
{
    //判断当前可用通道
    global $db;
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "phone_channel where id=1 and pkey='1' and (type='2' or type='3') order by id desc");
    //获取账户信息
    $username = $blog["username"];
    $password = $blog["password"];
    //获取接口信息
    $connection = explode('#515158#', $blog["connection"]);
    $personfor = explode(',', $person);
    $receivepersonfor = explode(',', $receiveperson);
    //$ef='';
    for ($i = 0; $i < sizeof($personfor); $i++) {
        if ($personfor[$i] != '') {
            $date = get_date('y-m-d H:i:s', PHP_TIME);
            $sms_add = explode('#01', $connection[2]);
            $ugcode_vod = new ugcode();
            $contentgdb2312 = $ugcode_vod->ugcode_vod(1, $content);
            $phoneurl = $sms_add[0] . trim($username) . $sms_add[1] . trim($password) . $sms_add[2] . trim($personfor[$i]) . $sms_add[3] . trim($contentgdb2312) . $sms_add[4] . $sms_add[5];
            $res = Utility::HttpRequest($phoneurl);
            if ($blog["connectionid"] == '1') {
                $res_sms = explode('/', $res);
                if ($res_sms[0] == '000') {
                    $type = '1';
                } else {
                    $type = '2';
                }
            } else {
                $res_sms = explode('&', $res);
                if ($res_sms[0] == 'result=0') {
                    $type = '1';
                } else {
                    $type = '2';
                }
            }
            //数据入库
            $phone_send = array('content' => $content, 'receivephone' => $personfor[$i], 'sendperson' => $userid, 'receiveperson' => $receivepersonfor[$i], 'date' => get_date('y-m-d H:i:s', PHP_TIME), 'type' => $type, 'channelid' => $blog["id"]);
            insert_db('phone_send', $phone_send);
            sleep(1);
        }
    }
}
开发者ID:haogm123,项目名称:ydoa,代码行数:43,代码来源:sms.class.php

示例6: get_data

function get_data($num, $url)
{
    $str = file_get_contents($url);
    $str = trim($str);
    $str = strtolower($str);
    if ($str == '') {
        $str = file_get_contents($url);
    }
    if ($str == '') {
        // recode error
        $fp = fopen('cantdown_' . $num, 'a+');
        fputs($fp, $num . '\\r\\n');
        fclose($fp);
    } else {
        $data = parse_html($str);
        if (insert_db($num, $data)) {
            echo $num . "is ok \r\n";
        }
    }
}
开发者ID:laiello,项目名称:pef,代码行数:20,代码来源:get_ip138.php

示例7: COUNT

            $wheresql .= " and uid='" . $vuidtype . "'";
        }
    }
    $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "sms_send WHERE 1 {$wheresql} ");
    $sql = "SELECT * FROM " . DB_TABLEPRE . "sms_send WHERE 1 {$wheresql} ORDER BY id desc LIMIT {$offset}, {$pagesize}";
    $result = $db->fetch_all($sql);
    include_once 'template/index.php';
} elseif ($do == 'update') {
    get_key("office_info_delete");
    $idarr = getGP('id', 'P', 'array');
    foreach ($idarr as $id) {
        $db->query("DELETE FROM " . DB_TABLEPRE . "sms_send WHERE id = '{$id}' ");
        //db->query("DELETE FROM ".DB_TABLEPRE."user_view WHERE uid = '$id'");
        if ($id != '') {
            $oalog = array('uid' => $_USER->id, 'content' => '删除内部短信', 'title' => '删除内部短信', 'startdate' => get_date('Y-m-d H:i:s', PHP_TIME), 'contentid' => $id, 'type' => '4');
            insert_db('oalog', $oalog);
        }
    }
    show_msg('短消息删除成功!', 'admin.php?ac=index&fileurl=sms&userkeytype=' . getGP('userkeytype', 'P') . '');
} elseif ($do == 'excel') {
    $datename = "sms_" . get_date('YmdHis', PHP_TIME);
    $outputFileName = 'data/excel/' . $datename . '.xls';
    $content = array();
    $archive = array("接收人", "发送人", "发送时间", "内容");
    $content[] = $archive;
    $wheresql = '';
    $vuidtype = getGP('vuidtype', 'P');
    if (!is_superadmin() && $vuidtype == '') {
        $wheresql .= " AND uid ='" . $_USER->id . "'";
    }
    if ($vuidtype != '') {
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_index.php

示例8: copy

    copy($tempfile, $newfile);
    $imgfold = $thispath . "/img";
    mkdir($imgfold, 0777);
    /*$test = "company/test";
    	$newtest = $tempMain."/test";
    	full_copy($test,$newtest);*/
}
//-------------------------- Check Interface Data
$sql_chk_interface = "select count(interfaceId) as totaldata from garageinterface where garageId = '" . $u_garage . "'";
$rs_chk_interface = mysql_query($sql_chk_interface);
$data_chk_interface = mysql_fetch_object($rs_chk_interface);
$chk_rowdata = $data_chk_interface->totaldata;
if ($chk_rowdata == 0) {
    $Table_Name = 'garageinterface';
    $data = array('interfaceLogo' => 'logo.png', 'interfaceBanner' => 'banner.jpg', 'interfaceFacebook' => 'https://www.facebook.com/', 'interfaceTwitter' => 'https://twitter.com/', 'interfaceGoogle' => 'https://plus.google.com/', 'garageId' => $u_garage);
    $sql = insert_db($Table_Name, $data);
    mysql_query($sql);
}
//-------------------------- Call Interface Data
$sql_interface = "select * from garageinterface where garageId = '" . $u_garage . "'";
$rs_interface = mysql_query($sql_interface);
$data_interface = mysql_fetch_object($rs_interface);
$interfaceLogo = $data_interface->interfaceLogo;
$interfaceBanner = $data_interface->interfaceBanner;
$interfaceFacebook = $data_interface->interfaceFacebook;
$interfaceTwitter = $data_interface->interfaceTwitter;
$interfaceGoogle = $data_interface->interfaceGoogle;
$garageAbout = $data_interface->garageAbout;
//-------------------------- Check Logo
$chk_logo = 0;
$pathLogo = $upload_dir . $interfaceLogo;
开发者ID:poliko6,项目名称:imatt-taxi,代码行数:31,代码来源:banner.1.show.php

示例9: getGP

    }
    if (getGP('tpladmin', 'P') != '') {
        $tpladmin = getGP('tpladmin', 'P');
    } else {
        $tpladmin = '0';
    }
    $uid = $_USER->id;
    if (getGP('tpladdr', 'P') != '') {
        $tpladdr = getGP('tpladdr', 'P');
    } else {
        $tpladdr = Pinyin($title) . '.php';
    }
    //主表信息
    $workclass_template = array('title' => $title, 'typeid' => $typeid, 'tplkey' => $tplkey, 'tpltype' => $tpltype, 'tpluser' => $tpluser, 'tpladmin' => $tpladmin, 'uid' => $uid, 'tpladdr' => $tpladdr);
    //写入主表信息
    insert_db('workclass_template', $workclass_template);
    $id = $db->insert_id();
    $content = serialize($workclass_template);
    $title = '添加工作流模型';
    get_logadd($id, $content, $title, 35, $_USER->id);
    show_msg('工作流模型添加成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
} elseif ($do == 'edit') {
    $tplid = getGP('tplid', 'G', 'int');
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "workclass_template  WHERE tplid = '{$tplid}'");
    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') != '') {
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_tpl.php

示例10: define

/*
	[Office 515158] (C) 2009-2012 天生创想 Inc.
	$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));
    }
}
//更新数据后取出当前总在线人数
开发者ID:haogm123,项目名称:ydoa,代码行数:30,代码来源:user_count.php

示例11: serialize

         $content = '';
         $content = serialize($registration);
         $title = '编辑考勤信息';
         get_logadd($id, $content, $title, 7, $_USER->id);
     } else {
         $name = check_str(getGP('user', 'P'));
         $uid = check_str(getGP('userid', 'P'));
         $startdate = getGP('startdate', 'P') . " " . getGP('starth', 'P') . ":" . getGP('starti', 'P') . ":00";
         $enddate = getGP('enddate', 'P') . " " . getGP('endh', 'P') . ":" . getGP('endi', 'P') . ":00";
         $startnote = check_str(getGP('startnote', 'P'));
         $endnote = check_str(getGP('endnote', 'P'));
         $date = check_str(getGP('date', 'P'));
         $startyype = check_str(getGP('startyype', 'P'));
         $endtype = check_str(getGP('endtype', 'P'));
         $registration = array('name' => $name, 'startdate' => $startdate, 'enddate' => $enddate, 'startnote' => $startnote, 'endnote' => $endnote, 'uid' => $uid, 'startyype' => $startyype, 'endtype' => $endtype, 'date' => $date);
         insert_db('registration', $registration);
         $id = $db->insert_id();
         $content = serialize($registration);
         $title = '录入考勤信息';
         get_logadd($id, $content, $title, 7, $_USER->id);
     }
     show_msg('考勤信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '');
 } else {
     $id = getGP('id', 'G', 'int');
     if ($id != '') {
         $user = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "registration  WHERE id = '{$id}'  ");
         $startdate = explode(' ', $user['startdate']);
         $starttime = explode(':', $startdate[1]);
         $enddate = explode(' ', $user['enddate']);
         $endtime = explode(':', $enddate[1]);
         $_title['name'] = '更改';
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_registration.php

示例12: foreach

            foreach (getGP('newinherited', 'P', 'array') as $name) {
                $newinherited .= $name . ',';
            }
            $newname = explode(',', substr($newname, 0, -1));
            $newinherited = explode(',', substr($newinherited, 0, -1));
            if ($newname != '') {
                for ($i = 0; $i < sizeof($newname); $i++) {
                    if ($newname[$i] != '') {
                        if ($newname[$i] == '') {
                            $newname[$i] = '新文件夹名称';
                        }
                        if ($newinherited[$i] != '') {
                            $fatherid = $newinherited[$i];
                        } else {
                            $fatherid = '0';
                        }
                        $document_type = array('title' => $newname[$i], 'father' => $fatherid, 'date' => $date, 'type' => $_GET['type'], 'uid' => $_USER->id);
                        insert_db('document_type', $document_type);
                    }
                }
            }
            $str = ',新增了<font color=red>' . sizeof($newname) . '</font>条信息';
        }
        show_msg('批量文件夹信息更新成功' . $str . '!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=documenttype&type=' . $_GET['type'] . '');
    } elseif ($_GET['view'] == 'typeupdate') {
        $db->query("DELETE FROM " . DB_TABLEPRE . "document_type WHERE id = '" . $_GET[id] . "'  ");
        $db->query("UPDATE " . DB_TABLEPRE . "document_type set father='" . $_GET['fid'] . "' WHERE father = '" . $_GET[id] . "'  ");
        show_msg('文件夹信息删除成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=documenttype&type=' . $_GET['type'] . '');
    }
    include_once 'template/documenttype.php';
}
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_document.php

示例13: array

         $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);
             }
         }
     }
     show_msg($_cname['name'] . '信息操作成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=bbsclass&otype=' . $otype);
 } elseif (getGP('id', 'G') != '') {
     $db->query("DELETE FROM " . DB_TABLEPRE . "office_type WHERE oid = '" . getGP('id', 'G') . "' ");
     /*$content=getGP('id','G').get_log(1).$_USER->id;
     		$title='删除'.$_cname['name'];
     		get_logadd(getGP('id','G'),$content,$title,30,$_USER->id);*/
     //都写了日志,唯这个还没有写
     show_msg($_cname['name'] . '信息删除成功!', 'admin.php?ac=' . $ac . '&fileurl=' . $fileurl . '&do=bbsclass&otype=' . $otype);
 } else {
     $sql = "SELECT * FROM " . DB_TABLEPRE . "office_type where otype='" . $otype . "'  ORDER BY oid asc";
     $result = $db->fetch_all($sql);
     include_once 'template/officeclass.php';
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_officeclass.php

示例14: 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

示例15: load_css

<?php

if (verif_connect()) {
    load_css('guild.css', 'guild');
    if (has_guild()) {
        if (has_guild_acces('recrutement')) {
            if (request_confirm('guild-engage') || request_confirm('guild-refuse')) {
                if (verifier_token(60, get_link('Recrutement', 'Guild'), 'guild-candidat-' . $_POST['Account_ID'])) {
                    $Account_Query = get_db("candidat_guild_confirm", array('Guild_ID' => guild_data('Guild_ID'), 'Account_ID' => request_post('Account_ID')));
                    if (!empty($Account_Query)) {
                        if (request_confirm('guild-engage')) {
                            update_db('Caranille_Accounts', stripslashes_r($_POST));
                            $message = "Vous avez été accepté dans la guilde " . guild_data('Guild_Name') . ".";
                        } else {
                            update_db('Caranille_Accounts', array('Account_ID' => $Account_Query['Account_ID'], 'Account_Guild_ID' => 0, 'Account_Guild_Accept' => 0));
                            $message = "Votre candidature dans la guilde " . guild_data('Guild_Name') . " a été refusé.";
                        }
                        add_diary($message, $Account_Query['Account_ID']);
                        insert_db('Caranille_Private_Messages', array('Private_Message_Transmitter' => logged_data('Account_ID'), 'Private_Message_Receiver' => $Account_Query['Account_Pseudo'], 'Private_Message_Subject' => "Votre candidature dans la guilde " . guild_data('Guild_Name'), 'Private_Message_Message' => $message, 'Private_Message_Conversation' => null));
                    }
                }
            }
        }
    }
}
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:25,代码来源:Recrutement.php


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