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


PHP db_query_bound函数代码示例

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


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

示例1: get_bug_id_from_artas_id

function get_bug_id_from_artas_id($t_artas_id)
{
    # ATR or ACP
    if (substr($t_artas_id, 0, 3) == "ATR") {
        $t_cstm_field = 55;
        $t_artas_id = str_replace("ATR", "", $t_artas_id);
    } else {
        if (substr($t_artas_id, 0, 3) == "ACP") {
            $t_cstm_field = 56;
            $t_artas_id = str_replace("ACP", "", $t_artas_id);
        } else {
            return "null";
        }
    }
    list($t_artas_id_number, $t_version) = split("-", $t_artas_id);
    $t_version = str_replace("_", " ", $t_version);
    $t_custom_table = db_get_table('mantis_custom_field_string_table');
    $t_bug_table = db_get_table('mantis_bug_table');
    $query = 'SELECT bug_id FROM ' . $t_custom_table . ',' . $t_bug_table . ' WHERE ' . $t_custom_table . '.bug_id = ' . $t_bug_table . '.id and field_id = ' . $t_cstm_field . ' AND value  = ' . $t_artas_id_number . ' and version = "' . $t_version . '"';
    $result = db_query_bound($query, null);
    $rows = array();
    $i = 0;
    while ($row = db_fetch_array($result)) {
        $rows[] = $row['bug_id'];
        $i++;
    }
    if ($i == 1) {
        return $rows[0];
    } else {
        return "null";
    }
}
开发者ID:bcramet,项目名称:CAMOSInternal,代码行数:32,代码来源:getATRForCAMOSTestReport.php

示例2: displayResultsCore

function displayResultsCore($query, $fields)
{
    $result = db_query_bound($query);
    $nbRows = 0;
    while ($row = db_fetch_array($result)) {
        $nbRows++;
        $t_bug = bug_get($row['id']);
        print "<tr> \n";
        print '<td><a href="' . string_get_bug_view_url($row['id']) . '">' . bug_format_id($row['id']) . '</a></td>';
        //print "<td> ".string_get_bug_view_url( ))." </td>\n";
        print "<td> " . string_display_line(get_enum_element('status', $t_bug->status)) . " </td>\n";
        print "<td> " . category_get_row($t_bug->category_id)['name'] . " </td>\n";
        print "<td> " . $t_bug->summary . " </td>\n";
        print "<td> " . user_get_field($t_bug->reporter_id, 'username') . " </td>\n";
        if ($t_bug->handler_id != null) {
            print "<td> " . user_get_field($t_bug->handler_id, 'username') . " </td>\n";
        }
        if (sizeof($fields) > 0) {
            for ($i = 0; $i < sizeof($fields); $i++) {
                print "<td> " . $row[$fields[$i]] . " </td>\n";
            }
        }
        print "</tr>\n";
    }
    return $nbRows;
}
开发者ID:bcramet,项目名称:CAMOSInternal,代码行数:26,代码来源:plugin_bug_util.php

示例3: renderIssues

    function renderIssues($status)
    {
        $content = array();
        $t_project_id = helper_get_current_project();
        $t_bug_table = db_get_table('mantis_bug_table');
        $t_user_id = auth_get_current_user_id();
        $specific_where = helper_project_specific_where($t_project_id, $t_user_id);
        if ($this->severity) {
            $severityCond = '= ' . $this->severity;
        } else {
            $severityCond = '> -1';
        }
        $query = "SELECT *\n\t\t\tFROM {$t_bug_table}\n\t\t\tWHERE {$specific_where}\n\t\t\tAND status = {$status}\n\t\t\tAND severity {$severityCond}\n\t\t\tORDER BY last_updated DESC\n\t\t\tLIMIT 20";
        $result = db_query_bound($query);
        $category_count = db_num_rows($result);
        for ($i = 0; $i < $category_count; $i++) {
            $row = db_fetch_array($result);
            //pre_var_dump($row);
            $content[] = '<div class="portlet ui-helper-clearfix" id="' . $row['id'] . '">
			<div class="portlet-header">' . string_get_bug_view_link($row['id']) . ': ' . $row['summary'] . '</div>
			<div class="portlet-content">' . ($row['reporter_id'] ? 'Reporter: ' . user_get_name($row['reporter_id']) . BR : '') . ($row['handler_id'] ? 'Assigned: ' . user_get_name($row['handler_id']) . BR : '') . '</div></div>';
        }
        if ($row) {
            //pre_var_dump(array_keys($row));
        }
        return $content;
    }
开发者ID:vboctor,项目名称:LikeTrello,代码行数:27,代码来源:trello.php

示例4: faq_count_query

function faq_count_query($p_project_id)
{
    global $g_mantis_faq_table;
    $query = "SELECT COUNT(*)\n\t\t\t\tFROM {$g_mantis_faq_table}\n\t\t\t\tWHERE project_id='{$p_project_id}' OR project_id='0000000'";
    $result = db_query_bound($query);
    return db_result($result, 0, 0);
}
开发者ID:xxNull-lsk,项目名称:faq,代码行数:7,代码来源:faq_api.php

示例5: helper_table_row_count

function helper_table_row_count($p_table)
{
    $t_table = $p_table;
    $query = "SELECT COUNT(*) FROM {$t_table}";
    $result = db_query_bound($query);
    $t_users = db_result($result);
    return $t_users;
}
开发者ID:kaos,项目名称:mantisbt,代码行数:8,代码来源:db_stats.php

示例6: fetch

 /**
  * Fetches given query.
  *
  * @param  string  $query
  * @param  array   $params
  * @return array
  */
 public function fetch($query, array $params = [])
 {
     $result = db_query_bound($query, $params);
     if (0 == db_num_rows($result)) {
         return [];
     }
     return $result->GetArray();
 }
开发者ID:andrzejkupczyk,项目名称:mantisbt-todolists,代码行数:15,代码来源:Repository.php

示例7: loadRelation

 /**
  * @author Lennard Bredenkamp, BFE
  * NOT USED AT THE MOMENT (loadRelations is used to load multiple relations instead)
  * get single tts_relation object from DB
  * @param $p_bug_id
  * @param $tts_exec_id
  * @return TTSrelation object
  */
 static function loadRelation($p_bug_id, $tts_exec_id)
 {
     $t_project_table = plugin_table('project', 'TTSintegr');
     $its_id = $p_bug_id;
     $t_query = "SELECT * FROM {$t_project_table} WHERE its_id=" . db_param() . " AND tts_exec_id=" . db_param();
     $t_result = db_query_bound($t_query, array($its_id, $tts_exec_id));
     $t_row = db_fetch_array($t_result);
     $t_relation = new TTSrelation($t_row['its_id'], $t_row['tts_exec_id'], $t_row['tts_tproject_id']);
     return $t_relation;
 }
开发者ID:bfekomsthoeft,项目名称:TTS_Praxisprojekt1,代码行数:18,代码来源:TTSintegr.API.php

示例8: add_format

function add_format($p_customer_name, $p_assembly_number, $p_revision, $p_format, $p_format_example, $new_customer, $new_assembly)
{
    $p_assembly_id = add_assembly($p_assembly_number, $p_revision, $p_customer_name, $new_customer, $new_assembly);
    global $g_mantis_serials_format;
    if ($new_assembly == 'true') {
        $query = "INSERT\n\t\t\t\t\tINTO {$g_mantis_serials_format}\n\t\t\t\t\t( format_id, assembly_id, format, format_example )\n\t\t\t\t\tVALUES\n\t\t\t\t\t( null, '{$p_assembly_id}', '{$p_format}', '{$p_format_example}' )";
        return db_query_bound($query);
    } else {
        $query = "UPDATE {$g_mantis_serials_format}\n\t\t\t\t\tSET format='{$p_format}', format_example='{$p_format_example}'\n\t\t\t\t\tWHERE assembly_id='{$p_assembly_id}'";
        return db_query_bound($query);
    }
}
开发者ID:khinT,项目名称:mantisbt-master,代码行数:12,代码来源:serials_api.php

示例9: get_project_package_list

/**
 * Created by PhpStorm.
 * User: wb-liuyuguang
 * Date: 14-7-31
 * Time: 下午1:30
 */
function get_project_package_list($p_package_id)
{
    $t_acra_prj_table = plugin_table("project");
    $query = "SELECT * FROM {$t_acra_prj_table} WHERE `project_id` = {$p_package_id} LIMIT 0, 1";
    $result = db_query_bound($query);
    $result = db_fetch_array($result);
    if ($result === false) {
        return;
    }
    $packages = $result['packages'];
    return handle_project_package_list($packages);
}
开发者ID:since2014,项目名称:MantisAcra,代码行数:18,代码来源:ProjectAcraExt.php

示例10: profile_exists

function profile_exists($p_platform, $p_os, $p_os_build)
{
    $t_user_profile_table = db_get_table('mantis_user_profile_table');
    $query_where = 'platform = ' . db_param() . ' and os = ' . db_param() . ' and os_build = ' . db_param();
    $query = "SELECT *\n\t\t\t\t  FROM {$t_user_profile_table}\n\t\t\t\t  WHERE {$query_where}\n\t\t\t\t  ORDER BY platform, os, os_build LIMIT 0,1";
    $result = db_query_bound($query, array($p_platform, $p_os, $p_os_build));
    $result = db_fetch_array($result);
    if ($result === false) {
        return false;
    }
    return $result['id'];
}
开发者ID:since2014,项目名称:MantisAcra,代码行数:12,代码来源:ProfileAcraExt.php

示例11: bug_get_attachments

function bug_get_attachments($p_bug_id)
{
    $c_bug_id = db_prepare_int($p_bug_id);
    $t_bug_file_table = db_get_table('mantis_bug_file_table');
    $query = "SELECT id, title, diskfile, filename, filesize, file_type, date_added, user_id\n                                FROM {$t_bug_file_table}\n                                WHERE bug_id=" . db_param() . "\n                                ORDER BY date_added";
    $db_result = db_query_bound($query, array($c_bug_id));
    $num_files = db_num_rows($db_result);
    $t_result = array();
    for ($i = 0; $i < $num_files; $i++) {
        $t_result[] = db_fetch_array($db_result);
    }
    return $t_result;
}
开发者ID:heaerie,项目名称:myroomexpense,代码行数:13,代码来源:getAttach.php

示例12: getAcraIssueList

function getAcraIssueList()
{
    $t_acra_issue_table = plugin_table("issue");
    $query = "SELECT * FROM {$t_acra_issue_table} WHERE `custom_data` REGEXP 'url'  ORDER BY `id` DESC";
    $result = db_query_bound($query);
    $list = array();
    while (true) {
        $row = db_fetch_array($result);
        if ($row === false) {
            break;
        }
        $list[] = $row;
    }
    return $list;
}
开发者ID:since2014,项目名称:MantisAcra,代码行数:15,代码来源:checkhttp.php

示例13: getAcraIssueList

function getAcraIssueList($page_num, $total_count)
{
    global $acra_id;
    $acra_id = $_GET['acra_hash'];
    $t_acra_issue_table = plugin_table("issue");
    $where = getFilterQueryString();
    $query = "SELECT * FROM {$t_acra_issue_table} WHERE `report_fingerprint`='" . $acra_id . "'" . $where . buildOrderString() . buildPageQueryString($page_num, $total_count);
    $result = db_query_bound($query);
    $list = array();
    while (true) {
        $row = db_fetch_array($result);
        if ($row === false) {
            break;
        }
        $list[] = $row;
    }
    return $list;
}
开发者ID:since2014,项目名称:MantisAcra,代码行数:18,代码来源:test.php

示例14: create

 public function create()
 {
     $t_issue_ext_table = plugin_table("issue");
     # Insert the rest of the data
     $query = "INSERT INTO {$t_issue_ext_table}\n\t\t\t\t\t    ( project_id ,              issue_id,       report_id,   report_fingerprint,\n                        file_path,               phone_model,    phone_build, phone_brand,\n                        product_name,            total_mem_size, available_mem_size, custom_data,\n                        initial_configuration,   crash_configuration, display, user_comment,\n                        dumpsys_meminfo,         dropbox,        eventslog,    radiolog,\n                        is_silent,               device_id,      installation_id,  user_email,\n                        device_features,         environment,    settings_system, settings_secure,\n                        shared_preferences,      android_version,app_version,     crash_date,\n                        report_date,             install_date\n\t\t\t\t\t    )\n\t\t\t\t\t  VALUES\n\t\t\t\t\t    ( " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . db_param() . ',' . db_param() . ',' . db_param() . ',' . db_param() . ",\n\t\t\t\t\t      " . 'now()' . ',' . db_param() . ')';
     $t_display_errors = config_get_global('display_errors');
     $t_on_error_handler = $t_display_errors[E_USER_ERROR];
     $t_display_errors[E_USER_ERROR] = "none";
     config_set_global('display_errors', $t_display_errors);
     $t_result = db_query_bound($query, array($this->project_id, $this->issue_id, $this->report_id, $this->report_fingerprint, $this->file_path, $this->phone_model, $this->phone_build, $this->phone_brand, $this->product_name, $this->total_mem_size, $this->available_mem_size, $this->custom_data, $this->initial_configuration, $this->crash_configuration, $this->display, $this->user_comment, $this->dumpsys_meminfo, $this->dropbox, $this->eventslog, $this->radiolog, $this->is_silent, $this->device_id, $this->installation_id, $this->user_email, $this->device_features, $this->environment, $this->settings_system, $this->settings_secure, $this->shared_preferences, $this->android_version, $this->app_version, $this->crash_date . $this->report_date, $this->install_date));
     $t_display_errors[E_USER_ERROR] = $t_on_error_handler;
     config_set_global('display_errors', $t_display_errors);
     if ($t_result === false) {
         return false;
     }
     $this->id = db_insert_id($t_issue_ext_table);
     return true;
 }
开发者ID:since2014,项目名称:MantisAcra,代码行数:18,代码来源:BugDataAcraExt.php

示例15: setBacklog

 /**
  * updates DB with new value
  * @param int $backlog
  * @throw exception on failure
  */
 public function setBacklog($backlog)
 {
     $old_backlog = NULL;
     $query = "SELECT value FROM codev_config_table WHERE config_id = " . db_param();
     $result = db_query_bound($query, array(IssueMantisPluginHelper::id_customField_backlog));
     $row = db_fetch_array($result);
     if ($row) {
         $backlogCustomField = $row['value'];
     } else {
         $backlogCustomField = 0;
     }
     // TODO should be done only once...
     $query = "SELECT name FROM mantis_custom_field_table WHERE id = " . db_param();
     $result = db_query_bound($query, array($backlogCustomField));
     $row = db_fetch_array($result);
     if ($row) {
         $field_name = $row['name'];
     } else {
         $field_name = "Backlog (BL)";
     }
     // check if backlog already defined for this issue
     $query = "SELECT value FROM `mantis_custom_field_string_table` WHERE bug_id=" . db_param() . " AND field_id = " . db_param();
     $result = db_query_bound($query, array($this->id, $backlogCustomField));
     $row = db_fetch_array($result);
     if ($row) {
         $old_backlog = $row['value'];
         $query2 = "UPDATE mantis_custom_field_string_table SET value = " . db_param() . " WHERE bug_id=" . db_param() . " AND field_id = " . db_param();
         $result2 = db_query_bound($query2, array($backlog, $this->id, $backlogCustomField));
     } else {
         $old_backlog = '';
         $query2 = "INSERT INTO mantis_custom_field_string_table (`field_id`, `bug_id`, `value`) VALUES (" . db_param() . ", " . db_param() . ", " . db_param() . ")";
         $result2 = db_query_bound($query2, array($backlogCustomField, $this->id, $backlog));
     }
     // Add to history
     if ("{$old_backlog}" != "{$backlog}") {
         $userid = current_user_get_field('id');
         $now = time();
         $query = "INSERT INTO mantis_bug_history_table  (`user_id`, `bug_id`, `field_name`, `old_value`, `new_value`, `type`, `date_modified`) " . "VALUES (" . db_param() . "," . db_param() . "," . db_param() . ", " . db_param() . ", " . db_param() . ", " . db_param() . ", " . db_param() . ")";
         $result = db_query_bound($query, array($userid, $this->id, $field_name, $old_backlog, $backlog, 0, $now));
     }
     // no need to update lastUpdated field
 }
开发者ID:fg-ok,项目名称:codev,代码行数:47,代码来源:IssueMantisPluginHelper.php


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