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


PHP MySQL::Kill方法代码示例

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


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

示例1: array

 function __construct($connect = true, $database = null, $server = null, $username = null, $password = null, $charset = "utf8", $port = null)
 {
     parent::__construct($connect, $database, $server, $username, $password, $charset, $port);
     if (parent::Error()) {
         parent::Kill();
     }
     $this->ErrorMsgs = array();
 }
开发者ID:aliihaidar,项目名称:pso,代码行数:8,代码来源:form.class.php

示例2: chapter_show_data

function chapter_show_data($id)
{
    $hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
    hook_action('chapter_show_data');
    if (!$hmdb->Query("SELECT * FROM " . DB_PREFIX . "content WHERE `status` = 'chapter' AND `parent` = '{$id}' ORDER BY id DESC")) {
        $hmdb->Kill();
    }
    $array_cha = array();
    while ($row = $hmdb->Row()) {
        $data_cha = content_data_by_id($row->id);
        $array_cha[] = array('id' => $row->id, 'name' => $row->name, 'slug' => $row->slug, 'public_time' => date('d-m-Y H:i', $data_cha['field']['public_time']));
    }
    $array['chapter'] = $array_cha;
    return hook_filter('chapter_show_data', json_encode($array, TRUE));
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:15,代码来源:chapter_model.php

示例3: define

    $_FILES = $HTTP_POST_FILES;
}
if (!isset($_SERVER)) {
    $_SERVER = $HTTP_SERVER_VARS;
}
if (!isset($_SESSION)) {
    $_SESSION = $HTTP_SESSION_VARS;
}
if (!isset($_POST)) {
    $_POST = $HTTP_POST_VARS;
}
if (!isset($_GET)) {
    $_GET = $HTTP_GET_VARS;
}
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
    #echo "LAVORO LOCALE";
    define("DB_HOST", '192.168.0.15');
    define("DB_USER", 'sil_booking');
    define("DB_PASSWORD", 'lignano');
    define("DB_NAME", 'kicero');
} else {
}
define("VAT_VALUE", 22);
define("VAT_VALUE_X", 1.22);
require_once dirname(__FILE__) . '/config.inc.php';
require_once dirname(__FILE__) . '/db.class.inc.php';
#require_once dirname(__FILE__).'/ezmc.class.inc.php';
$db = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD);
if ($db->Error()) {
    $db->Kill("Errore connessione a DB");
}
开发者ID:Zanej,项目名称:cms,代码行数:31,代码来源:db_connection.php

示例4: int

-- SQL to generate test table
-- --------------------------------------------
CREATE TABLE `test` (
  `TestID` int(10)     NOT NULL auto_increment,
  `Color`  varchar(15) default NULL,
  `Age`    int(10)     default NULL,
  PRIMARY KEY  (`TestID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------
*/
// --- Open the database --------------------------------------------
// (Also note that you can fill in the variables in the top of the class
// if you want to automatically connect when the object is created. If
// you fill in the values when you create the obect, this is not needed.)
if (!$db->Open("test", "localhost", "root", "password")) {
    $db->Kill();
}
echo "You are connected to the database<br />\n";
// --- Insert a new record ------------------------------------------
$sql = "INSERT INTO Test (Color, Age) Values ('Red', 7)";
if (!$db->Query($sql)) {
    $db->Kill();
}
echo "Last ID inserted was: " . $db->GetLastInsertID();
// --- Or insert a new record with transaction processing -----------
$sql = "INSERT INTO Test (Color, Age) Values ('Blue', 3)";
$db->TransactionBegin();
if ($db->Query($sql)) {
    $db->TransactionEnd();
    echo "Last ID inserted was: " . $db->GetLastInsertID() . "<br /><br />\n";
} else {
开发者ID:kimai,项目名称:kimai,代码行数:31,代码来源:example.php

示例5: while

 if (!$db->Query($fullquery)) {
     $db->Kill($db->Error());
 }
 $nbrlocalreq = $db->RowCount();
 while (!$db->EndOfSeek()) {
     $row = $db->Row();
     $dbd->Query($row->req);
 }
 $db->Query("update temprequet set stat=1 where stat=0");
 // ---------------------------------------------------
 // Execute Remote requete on locoal server
 // ---------------------------------------------------
 global $db;
 $fullquery = "SELECT req,id from temprequet where stat=0 ";
 if (!$dbd->Query($fullquery)) {
     $dbd->Kill($dbd->Error());
 }
 $nbrremotreq = $dbd->RowCount();
 while (!$dbd->EndOfSeek()) {
     $row = $dbd->Row();
     if (!$db->Query($row->req)) {
         $db->Kill($db->Error());
     } else {
         $dbd->Query("update temprequet set stat=1 where id=" . $row->id);
     }
 }
 // ---------------------------------------------------
 // Insert log Last update
 // ---------------------------------------------------
 $nbrreq = $nbrlocalreq + $nbrremotreq;
 $lastmaj = "Insert into maj_sys(nbrreq,user)values({$nbrreq}," . $_SESSION['userid'] . ")";
开发者ID:ATS001,项目名称:MRN,代码行数:31,代码来源:sync_c.php

示例6: array

Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem($APP_DIR . "/template");
if ($config->twig_cache) {
    $twig = new Twig_Environment($loader, array('debug' => $config->twig_debug, 'cache' => $APP_DIR . "/cache/" . $env));
} else {
    $twig = new Twig_Environment($loader, array('debug' => $config->twig_debug, 'cache' => ""));
}
//load extentions
$twig->addExtension(new Twig_Extension_User());
// BootStrap framework object
$cms = new bootstrap();
// Database framework object
$db = new MySQL();
if (!$db->Open($config->db_name, $config->db_host, $config->db_user, $config->db_pass)) {
    echo "There was a error connecting to the database of ssa, please try again later.";
    @$db->Kill();
}
$db->ThrowExceptions = true;
// User object
$user = new user();
//Set error settings
if ($config->debug) {
    error_reporting(-1);
    ini_set('display_errors', '1');
} else {
    error_reporting(0);
    ini_set('display_errors', '0');
}
// Stop loading stuff below, because its media
if (strpos((string) $_SERVER['REQUEST_URI'], "media/")) {
    $file = $APP_DIR . "/public" . $_SERVER['REQUEST_URI'];
开发者ID:sNakiex,项目名称:StendenTwitter,代码行数:31,代码来源:loader.php

示例7: user_show_data

/** bảng danh sách thành viên */
function user_show_data($user_group, $perpage)
{
    $hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
    hook_action('user_show_data');
    $request_paged = hm_get('paged', 1);
    $paged = $request_paged - 1;
    $offset = $paged * $perpage;
    $limit = "LIMIT {$perpage} OFFSET {$offset}";
    if (!$hmdb->Query("SELECT * FROM " . DB_PREFIX . "users WHERE `user_group` = '{$user_group}' ORDER BY id DESC {$limit}")) {
        $hmdb->Kill();
    }
    if ($hmdb->HasRecords()) {
        /* Trả về các user */
        while ($row = $hmdb->Row()) {
            $array_use[] = array('id' => $row->id, 'user_nicename' => $row->user_nicename, 'user_role' => user_role_id_to_nicename($row->user_role));
        }
        $array['user'] = $array_use;
        /* Tạo pagination */
        $hmdb->Query(" SELECT * FROM " . DB_PREFIX . "users WHERE `user_group` = '{$user_group}' ");
        $total_item = $hmdb->RowCount();
        $total_page = ceil($total_item / $perpage);
        $first = '1';
        if ($request_paged > 1) {
            $previous = $request_paged - 1;
        } else {
            $previous = $first;
        }
        if ($request_paged < $total_page) {
            $next = $request_paged + 1;
        } else {
            $next = $total_page;
        }
        $array['pagination'] = array('first' => $first, 'previous' => $previous, 'next' => $next, 'last' => $total_page, 'total' => $total_item, 'paged' => $request_paged);
    } else {
        $array['user'] = array();
        $array['pagination'] = array();
    }
    return hook_filter('user_show_data', json_encode($array, TRUE));
}
开发者ID:hoamaisoft,项目名称:hoamai-cms-beta-1.0,代码行数:40,代码来源:user_model.php

示例8: content_show_data

function content_show_data($key, $status, $perpage)
{
    global $hmcontent;
    $hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
    hook_action('content_show_data');
    $request_paged = hm_get('paged', 1);
    $paged = $request_paged - 1;
    $offset = $paged * $perpage;
    $limit = "LIMIT {$perpage} OFFSET {$offset}";
    if (!$hmdb->Query("SELECT * FROM " . DB_PREFIX . "content WHERE `key` = '{$key}' AND status = '{$status}' ORDER BY id DESC {$limit}")) {
        $hmdb->Kill();
    }
    if ($hmdb->HasRecords()) {
        /* Trả về các content */
        while ($row = $hmdb->Row()) {
            $array_con[] = array('id' => $row->id, 'name' => $row->name, 'slug' => $row->slug);
        }
        $array['content'] = $array_con;
        /* Tạo pagination */
        $hmdb->Query(" SELECT * FROM " . DB_PREFIX . "content WHERE `key` = '{$key}' AND status = '{$status}' ");
        $total_item = $hmdb->RowCount();
        $total_page = ceil($total_item / $perpage);
        $first = '1';
        if ($request_paged > 1) {
            $previous = $request_paged - 1;
        } else {
            $previous = $first;
        }
        if ($request_paged < $total_page) {
            $next = $request_paged + 1;
        } else {
            $next = $total_page;
        }
        $array['pagination'] = array('first' => $first, 'previous' => $previous, 'next' => $next, 'last' => $total_page, 'total' => $total_item, 'paged' => $request_paged);
        $all_content = $hmcontent->hmcontent;
        if (isset($all_content[$key]['chapter']) and $all_content[$key]['chapter'] == TRUE) {
            $array['chapter'] = TRUE;
        } else {
            $array['chapter'] = FALSE;
        }
    } else {
        $array['content'] = array();
        $array['pagination'] = array();
        $array['chapter'] = FALSE;
    }
    return hook_filter('content_show_data', json_encode($array, TRUE));
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:47,代码来源:content_model.php

示例9: MySQL

            $kga['server_password'] = $server_ext_password[$dbnr];
        }
        if ($server_ext_prefix[$dbnr] != '') {
            $kga['server_prefix'] = $server_ext_prefix[$dbnr];
        }
    }
} else {
    if (isset($_COOKIE['kimai_db']) && $_COOKIE['kimai_db'] == true) {
        $dbnr = $_COOKIE['kimai_db'] - 1;
        $kga['server_database'] = $server_ext_database[$dbnr];
        if ($server_ext_username[$dbnr] != '') {
            $kga['server_username'] = $server_ext_username[$dbnr];
        }
        if ($server_ext_password[$dbnr] != '') {
            $kga['server_password'] = $server_ext_password[$dbnr];
        }
        if ($server_ext_prefix[$dbnr] != '') {
            $kga['server_prefix'] = $server_ext_prefix[$dbnr];
        }
    }
}
// ===========================================================================
include WEBROOT . "libraries/mysql.class.php";
if (isset($utf8) && $utf8) {
    $conn = new MySQL(true, $kga['server_database'], $kga['server_hostname'], $kga['server_username'], $kga['server_password'], "utf-8");
} else {
    $conn = new MySQL(true, $kga['server_database'], $kga['server_hostname'], $kga['server_username'], $kga['server_password']);
}
if ($conn->Error()) {
    $conn->Kill();
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:31,代码来源:connect_mysql.php

示例10:

    $where .= " ( employee_name LIKE '" . $params['search']['value'] . "%' ";
    $where .= " OR employee_salary LIKE '" . $params['search']['value'] . "%' ";
    $where .= " OR employee_age LIKE '" . $params['search']['value'] . "%' )";
}
// getting total number records without any search
$sql = "SELECT * FROM `employee` ";
$sqlTot .= $sql;
$sqlRec .= $sql;
//concatenate search sql if value exist
if (isset($where) && $where != '') {
    $sqlTot .= $where;
    $sqlRec .= $where;
}
$sqlRec .= " ORDER BY " . $columns[$params['order'][0]['column']] . "   " . $params['order'][0]['dir'] . "  LIMIT " . $params['start'] . " ," . $params['length'] . " ";
if (!$db->Query($sqlTot)) {
    $db->Kill($db->Error());
}
//$queryTot = mysqli_query($conn, $sqlTot) or die("database error:". mysqli_error($conn));
$totalRecords = $db->RowCount();
//$totalRecords = mysqli_num_rows($queryTot);
if (!$db->Query($sqlRec)) {
    $db->Kill($db->Error());
}
//$queryRecords = mysqli_query($conn, $sqlRec) or die("error to fetch employees data");
//iterate on results row and create new index array of data
while (!$db->EndOfSeek()) {
    $row = $db->RowValue();
    $data[] = $row;
}
//while( $row = mysqli_fetch_row($queryRecords) ) {
//$data[] = $row;
开发者ID:ATS001,项目名称:PRSIT,代码行数:31,代码来源:response.php

示例11: exit

<?php

/** 
 * Xử lý kết nối database
 * Vị trí : hm_include/database.php 
 */
if (!defined('BASEPATH')) {
    exit('403');
}
/**
 * Gọi thư viện mysql
 */
require_once BASEPATH . HM_INC . '/database/mysql.php';
/**
 * Kết nối mysql
 */
$hmdb = new MySQL(true, DB_NAME, DB_HOST, DB_USER, DB_PASSWORD, DB_CHARSET);
if (!$hmdb->IsConnected()) {
    exit('Không thể kết nối đến cơ sở dữ liệu');
} else {
    if ($hmdb->Error()) {
        exit($hmdb->Kill());
    }
    $hmdb->Query('SET NAMES "UTF8"');
}
开发者ID:butkimtinh,项目名称:hoamai-cms-beta-1.0,代码行数:25,代码来源:database.php

示例12: SetUpLanguageAndLocale

}
// blow away $cfg['language'] to ensure the language file(s) are loaded this time - it's our first anyhow.
unset($cfg['language']);
$language = SetUpLanguageAndLocale($language);
// SECURITY ==
// Include security file only for administration directory
$location = explode("/", $_SERVER['PHP_SELF']);
$php_src_is_admin_code = in_array("admin", $location);
if ($php_src_is_admin_code) {
    /*MARKER*/
    require_once BASE_PATH . '/admin/includes/security.inc.php';
}
// DATABASE ==
// All set! Now this statement will connect to the database
if (!$db->Open($cfg['db_name'], $cfg['db_host'], $cfg['db_user'], $cfg['db_pass'])) {
    $db->Kill($ccms['lang']['system']['error_database']);
}
// ENVIRONMENT ==
// Some variables to help this file orientate on its environment
$current = basename(filterParam4FullFilePath($_SERVER['REQUEST_URI']));
// [i_a] $curr_page was identical (enough) to $pagereq before
$pagereq = checkSpecialPageName(getGETparam4Filename('page'), SPG_GIVE_PAGENAME);
$ccms['pagereq'] = $pagereq;
$ccms['printing'] = getGETparam4boolYN('printing', 'N');
$preview = getGETparam4IdOrNumber('preview');
// in fact, it's a hash plus ID!
$preview = IsValidPreviewCode($preview);
$ccms['preview'] = $preview ? 'Y' : 'N';
//$ccms['responsecode'] = null; // default: 200 : OK
//$ccms['page_id'] = false;
//$ccms['page_name'] = false;
开发者ID:GerHobbelt,项目名称:CompactCMS,代码行数:31,代码来源:sitemap.php


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