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


PHP qa_db_last_insert_id函数代码示例

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


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

示例1: qa_db_user_create_by_id

function qa_db_user_create_by_id($FbId, $email, $password, $handle, $level, $ip)
{
    require_once QA_INCLUDE_DIR . 'qa-util-string.php';
    $salt = isset($password) ? qa_random_alphanum(16) : null;
    qa_db_query_sub('INSERT INTO ^users (userid,created, createip, email, passsalt, passcheck, level, handle, loggedin, loginip) ' . 'VALUES ($,NOW(), COALESCE(INET_ATON($), 0), $, $, UNHEX($), #, $, NOW(), COALESCE(INET_ATON($), 0))', $FbId, $ip, $email, $salt, isset($password) ? qa_db_calc_passcheck($password, $salt) : null, (int) $level, $handle, $ip);
    return qa_db_last_insert_id();
}
开发者ID:bafio89,项目名称:qea-u,代码行数:7,代码来源:qa-db-users.php

示例2: widget_opt_update

function widget_opt_update($name, $position, $order, $param, $id = false)
{
    if ($id) {
        qa_db_query_sub('UPDATE ^cs_widgets SET position = $, widget_order = #, param = $ WHERE id=#', $position, $order, $param, $id);
        return $id;
    } else {
        qa_db_query_sub('INSERT ^cs_widgets (name, position, widget_order, param) VALUES ($, $, #, $)', $name, $position, $order, $param);
        return qa_db_last_insert_id();
    }
}
开发者ID:microbye,项目名称:CleanStrap,代码行数:10,代码来源:functions.php

示例3: qa_db_post_create

function qa_db_post_create($type, $parentid, $userid, $cookieid, $ip, $title, $content, $format, $tagstring, $notify, $categoryid = null, $name = null)
{
    qa_db_query_sub('INSERT INTO ^posts (categoryid, type, parentid, userid, cookieid, createip, title, content, format, tags, notify, name, created) ' . 'VALUES (#, $, #, $, #, INET_ATON($), $, $, $, $, $, $, NOW())', $categoryid, $type, $parentid, $userid, $cookieid, $ip, $title, $content, $format, $tagstring, $notify, $name);
    return qa_db_last_insert_id();
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:5,代码来源:qa-db-post-create.php

示例4: qa_db_message_create

function qa_db_message_create($fromuserid, $touserid, $content, $format)
{
    qa_db_query_sub('INSERT INTO ^messages (fromuserid, touserid, content, format, created) VALUES (#, #, $, $, NOW())', $fromuserid, $touserid, $content, $format);
    return qa_db_last_insert_id();
}
开发者ID:ramo01,项目名称:1kapp,代码行数:5,代码来源:qa-db-messages.php

示例5: qa_db_usernotice_create

function qa_db_usernotice_create($userid, $content, $format = '', $tags = null)
{
    qa_db_query_sub('INSERT INTO ^usernotices (userid, content, format, tags, created) VALUES ($, $, $, $, NOW())', $userid, $content, $format, $tags);
    return qa_db_last_insert_id();
}
开发者ID:swuit,项目名称:swuit-q2a,代码行数:5,代码来源:notices.php

示例6: qa_db_widget_create

function qa_db_widget_create($title, $tags)
{
    $position = qa_db_read_one_value(qa_db_query_sub('SELECT 1+COALESCE(MAX(position), 0) FROM ^widgets'));
    qa_db_query_sub('INSERT INTO ^widgets (place, position, tags, title) VALUES (\'\', #, $, $)', $position, $tags, $title);
    return qa_db_last_insert_id();
}
开发者ID:swuit,项目名称:swuit-q2a,代码行数:6,代码来源:admin.php

示例7: save_widget

 private function save_widget()
 {
     $widget = array();
     $widget['id'] = qa_post_text('wid');
     $widget['title'] = qa_post_text('wtitle');
     $widget['position'] = qa_post_text('wposition');
     $widget['ordering'] = qa_post_text('wordering');
     $widget['content'] = qa_post_text('wcontent');
     $pages = array();
     if (qa_post_text('wpages_all')) {
         $pages[] = 'all';
     } else {
         foreach ($this->templatelangkeys as $key => $lang) {
             if (qa_post_text('wpages_' . $key)) {
                 $pages[] = $key;
             }
         }
         if (qa_post_text('cb_custom_pages')) {
             $wpages_custom = explode(',', qa_post_text('wpages_custom'));
             foreach ($wpages_custom as $cp) {
                 $pages[] = 'custom:' . $cp;
             }
         }
     }
     $widget['pages'] = implode(',', $pages);
     if ($widget['id'] === '0') {
         $sql = 'INSERT INTO ^' . $this->pluginkey . ' (id, title, pages, position, ordering, content) VALUES (0, $, $, $, #, $)';
         $success = qa_db_query_sub($sql, $widget['title'], $widget['pages'], $widget['position'], $widget['ordering'], $widget['content']);
         $widget['id'] = qa_db_last_insert_id();
     } else {
         $sql = 'UPDATE ^' . $this->pluginkey . ' SET title=$, pages=$, position=$, ordering=#, content=$ WHERE id=#';
         $success = qa_db_query_sub($sql, $widget['title'], $widget['pages'], $widget['position'], $widget['ordering'], $widget['content'], $widget['id']);
     }
     return $widget;
 }
开发者ID:siddiquinoor,项目名称:q2a-widget-anywhere,代码行数:35,代码来源:qa-widget-anywhere.php

示例8: qa_db_message_create

function qa_db_message_create($fromuserid, $touserid, $content, $format, $public = false)
{
    qa_db_query_sub('INSERT INTO ^messages (type, fromuserid, touserid, content, format, created) VALUES ($, #, #, $, $, NOW())', $public ? 'PUBLIC' : 'PRIVATE', $fromuserid, $touserid, $content, $format);
    return qa_db_last_insert_id();
}
开发者ID:gogupe,项目名称:question2answer-releases,代码行数:5,代码来源:qa-db-messages.php

示例9: qw_dump_email_to_db

function qw_dump_email_to_db($notifying_user, $queue_id)
{
    qa_db_query_sub('INSERT INTO ^ra_email_queue_receiver (userid, handle, email , name , queue_id ) ' . 'VALUES (#, $, $ , $ , # )', $notifying_user['userid'], $notifying_user['handle'], $notifying_user['email'], $notifying_user['name'], $queue_id);
    return qa_db_last_insert_id();
}
开发者ID:rahularyan,项目名称:dude-theme,代码行数:5,代码来源:email-events.php

示例10: updateQues

function updateQues($postid, $title = null, $content = null, $areaclass = null, $conclass = null, $tags = null, $istop = -1, $ishot = -1)
{
    $post = qa_post_get_full($postid);
    if ($istop == 1) {
        //如果设置了置顶,则将同类其它的帖子取消置顶
        setTopQuestion($postid);
    } elseif ($istop == 0) {
        unsetTopQuestion($postid);
    }
    if ($ishot == 1) {
        setHotQA($postid);
    } elseif ($ishot == 0) {
        unsetHotQA($postid);
    }
    if (!isset($title)) {
        $title = $post['title'];
    }
    if (!isset($content)) {
        $content = $post['content'];
    }
    if (!isset($areaclass)) {
        $title = @$post['areaclass'];
    }
    if (!isset($conclass)) {
        $content = @$post['conclass'];
    }
    $query = 'UPDATE ^posts set title=$, content=$, areaclass=$, conclass=$,tags=$';
    $query .= ' where postid= $';
    // echo $query.'<br />';
    // for ($i=0; $i < func_num_args(); $i++) {
    // 	$arg = func_get_arg($i);
    // 	echo $arg.'<br />';
    // }
    $arr = qa_db_query_sub($query, $title, $content, $areaclass, $conclass, $tags, $postid);
    return qa_db_last_insert_id();
}
开发者ID:GitFuture,项目名称:bmf,代码行数:36,代码来源:console.php

示例11: post_message

 private function post_message($data)
 {
     $sql = 'INSERT INTO ^chat_posts (postid, userid, posted, message) VALUES (0, #, $, $)';
     qa_db_query_sub($sql, $data['userid'], $data['posted'], $data['message']);
     return qa_db_last_insert_id();
 }
开发者ID:microbye,项目名称:q2a-chat-room,代码行数:6,代码来源:qa-chat.php


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