• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP MysqliDb类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getListComposersDb

function getListComposersDb()
{
    $db = new MysqliDb(HOST, USER, PASSWORD, DBNAME);
    $query = "SELECT * FROM composers";
    $composers = $db->rawQuery($query);
    return $composers;
}
开发者ID:ojoven,项目名称:amadeus,代码行数:7,代码来源:functions.php


示例2: GET

 function GET()
 {
     $db = new MysqliDb($this->config["host"], $this->config["user"], $this->config["pass"], $this->config["base"]);
     $results = $db->get('VIP');
     if (!empty($results) && count($results) > 0) {
         SimplestView::render('index', array("results" => $results));
     }
 }
开发者ID:rittme,项目名称:Voicela,代码行数:8,代码来源:Home.php


示例3: json_encode

        echo json_encode(true);
    } else {
        echo json_encode(false);
    }
}
function update($item)
{
    $db = new MysqliDb();
    $decoded = json_decode($item);
    $db->where('revista_id', $decoded->revista_id);
    $data = array('nombre' => $decoded->nombre, 'link' => $decoded->link);
    if ($db->update('revistas', $data)) {
开发者ID:arielcessario,项目名称:uiglp,代码行数:12,代码来源:revistas.php


示例4: GET

 function GET($matches)
 {
     if ($matches[1]) {
         $db = new MysqliDb($this->config["host"], $this->config["user"], $this->config["pass"], $this->config["base"]);
         $results = $db->where('idphoto', $matches[1])->get('photo', 1);
         if (!empty($results) && count($results) > 0) {
             header("Content-Type: image/jpg");
             header("Content-Length: " . strlen($results[0]["contenu"]));
             echo $results[0]["contenu"];
         }
     }
 }
开发者ID:rittme,项目名称:Voicela,代码行数:12,代码来源:index.php


示例5: json_encode

        echo json_encode(true);
    } else {
        echo json_encode(false);
    }
}
/**
 * esta funcion me retorna un cliente filtrando x email
 * @param $email
 */
function update($item)
{
    $db = new MysqliDb();
    $decoded = json_decode($item);
开发者ID:arielcessario,项目名称:uiglp,代码行数:13,代码来源:ofertas_laborales.php


示例6: insertCompositionsOnDB

function insertCompositionsOnDB()
{
    $composers = getListComposers();
    foreach ($composers as $index => $composer) {
        $slug = getSlugComposer($composer);
        $relevance = $index + 1;
        $db = new MysqliDb(HOST, USER, PASSWORD, DBNAME);
        $query = "INSERT INTO `composers`(`slug`,`name`,`relevance`)";
        $query .= " VALUES ('" . $slug . "','" . $composer . "','" . $relevance . "');";
        echo $query . PHP_EOL;
        $db->rawQuery($query);
    }
}
开发者ID:ojoven,项目名称:amadeus,代码行数:13,代码来源:getcomposers.php


示例7: order_paid

function order_paid()
{
    require_once './submodules/php-mysqli-database-class/MysqliDb.php';
    require './includes/config.php';
    $db = new MysqliDb($db_host, $db_user, $db_pass, $db_name);
    $payid = $_GET['out_trade_no'];
    $aPayId = explode('_', $payid);
    $mtrid = $aPayId[1];
    $params = json_encode($_GET);
    //验证是否已经支付过
    $db->where("mtr_id = '{$mtrid}'")->get('mark_trafficpolice_reward');
    if ($db->count == 0) {
        $aNew = array('mtr_id' => $mtrid, 'pay_id' => $payid, 'pay_success' => 1, 'pay_money' => $_GET['total_fee'], 'pay_date' => $_GET['gmt_payment'], 'pay_params' => $params, 'created_date' => $db->now());
        $id = $db->insert('mark_trafficpolice_reward', $aNew);
        //给用户增加余额
        $sql = "SELECT mt.user_id,u.user_money FROM `mark_trafficpolice` mt\n            LEFT JOIN mark_trafficpolice_received mtr ON mt.id=mtr.mt_id\n            LEFT JOIN users u ON u.user_id=mt.user_id\n            WHERE mtr.id= '{$mtrid}'";
        $aUser = $db->rawQuery($sql);
        if ($db->count) {
            $aUpdate = array('user_money' => $aUser[0]['user_money'] + $_GET['total_fee'], 'updated_date' => $db->now());
            $db->where('user_id', $aUser[0]['user_id']);
            $db->update('users', $aUpdate);
        }
    } else {
        echo "already rewarded";
    }
}
开发者ID:szgongyi,项目名称:TrafficPolice-Web,代码行数:26,代码来源:alipay.php


示例8: getInstance

 public static function getInstance($dbKey = 'DB')
 {
     if (array_key_exists($dbKey, self::$db)) {
         return self::$db[$dbKey];
     } else {
         $newdb = new MysqliDb($dbKey);
         if ($newdb->connect()) {
             self::$db[$dbKey] = $newdb;
             return $newdb;
         } else {
             return false;
         }
     }
 }
开发者ID:bsdcfp,项目名称:wxmp,代码行数:14,代码来源:DbFactory.php


示例9: insertComposersOnDB

function insertComposersOnDB()
{
    $db = new MysqliDb(HOST, USER, PASSWORD, DBNAME);
    $composers = getListComposersDb();
    foreach ($composers as $index => $composer) {
        $compositions = extractCompositionsFromSearchHtmls($composer['name']);
        foreach ($compositions as $composition) {
            echo "Inserting " . $composition . "..." . PHP_EOL;
            $relevance = $index + 1;
            $query = "INSERT INTO `compositions`(`composer_id`,`name`,`relevance`)";
            $query .= " VALUES ('" . $composer['id'] . "','" . escapeSingleQuote($composition) . "','" . $relevance . "');";
            $db->rawQuery($query);
        }
    }
}
开发者ID:ojoven,项目名称:amadeus,代码行数:15,代码来源:addcompositionsdb.php


示例10: showzx

function showzx()
{
    $zid = req('zid');
    $start = req('start', 0);
    $perpage = req('perpage', 0);
    if ($start < 0) {
        $start = 0;
    }
    if (empty($perpage)) {
        $perpage = 30;
    }
    if (empty($zid)) {
        showjson('zid_not_exist');
    }
    $db = MysqliDb::getInstance();
    $data = $db->rawQueryOne("SELECT z.*, u.username FROM zixun z LEFT JOIN users u ON z.uid=u.uid WHERE z.zid='{$zid}'");
    if ($db->count > 0) {
        $db->where("zid", $zid);
        $stats = $db->getOne("comment", "count(*) as cnt");
        $data['total'] = $stats['cnt'];
        //if($start>=$data['total']) $start=0;
        $comment = $db->rawQuery("SELECT c.*,s.username FROM comment c LEFT JOIN users s ON c.uid=s.uid WHERE c.zid='{$zid}' ORDER BY c.cid LIMIT {$start},{$perpage}");
        $data['count'] = $db->count;
        $data['comment'] = $comment;
        showjson('do_success', 0, array("zixun" => $data));
    }
    showjson('show_error');
}
开发者ID:NaturalWill,项目名称:Simple-Healthcare-Consulting-System-API,代码行数:28,代码来源:view.php


示例11: saveSlider

function saveSlider($slider)
{
    $db = new MysqliDb();
    $item_decoded = $slider;
    //    $fotos_decoded = json_decode($producto->fotos);
    $db->where('oferta_id', $item_decoded->slider_id);
    $data = array('producto_id' => $item_decoded->producto_id, 'precio' => $item_decoded->precio, 'descripcion' => $item_decoded->descripcion, 'imagen' => $item_decoded->imagen, 'titulo' => $item_decoded->titulo);
    $results = $db->update('ofertas', $data);
    $res = ['status' => 1, 'results' => 0];
    echo json_encode($results);
    if ($results) {
        $res["results"] = $results;
        echo json_encode($res);
    } else {
        $res->status = 0;
        echo $res;
    }
}
开发者ID:arielcessario,项目名称:ac-angular-slider-manager,代码行数:18,代码来源:slider-manager.php


示例12: __construct

 public function __construct()
 {
     /** @var array $db */
     include_once 'config.php';
     require_once 'PHP-MySQLi-Database-Class-master/MysqliDb.php';
     new MysqliDb($db);
     $this->db_instance = MysqliDb::getInstance();
     $this->db_config = $db;
 }
开发者ID:akd3vs,项目名称:fer-example,代码行数:9,代码来源:Utils.php


示例13: __construct

 /**
  * constructor
  *
  * @param string $type tipo de datamanager a ser incializado
  *
  * inicializa o objeto de log e de bd
  * inicializa o vetor de dados nulo de acordo com o tipo
  */
 function __construct($type)
 {
     $this->db = MysqliDb::getInstance();
     $this->log = Log::getInstance();
     //tipo de dado valido pra iniciar
     if (array_key_exists($type, $this->_validFields)) {
         $this->type = $type;
         foreach ($this->_validFields[$this->type] as $key => $value) {
             $this->setField($key, null);
         }
     }
 }
开发者ID:andrefedalto,项目名称:htv,代码行数:20,代码来源:DataManager.php


示例14: routeToCrm

 public function routeToCrm($host, $username, $password, $databaseName)
 {
     if (isset($_COOKIE['username'])) {
         $user = $_COOKIE['username'];
     }
     if (isset($_COOKIE['mdp'])) {
         //Récupération du mot de passe stocké
         $db = new MysqliDb($host, $username, $password, $databaseName);
         $db->where("user_name", $user);
         $users = $db->getOne("users");
         $pwd = $users['user_hash'];
         // Création du mot de passe hashé
         // $mdp = crypt(strtolower($_COOKIE['mdp']),$pwd);
         $mdp = $_COOKIE['mdp'];
     }
     // Login au CRM
     $url = "http://localhost/mysite/crm74/service/v4_1/soap.php?wsdl";
     require_once "../crm74/include/nusoap/lib/nusoap.php";
     //retrieve WSDL
     $client = new nusoap_client($url, 'wsdl');
     $proxy = $client->getProxy();
     //Affichage des erreurs
     $err = $client->getError();
     if ($err) {
         echo '<h2>Erreur du constructeur</h2><pre>' . $err . '</pre>';
         echo '<h2>Debug</h2><pre>' . htmlspecialchars($client->getDebug(), ENT_QUOTES) . '</pre>';
         exit;
     }
     // login ----------------------------------------------------
     $login_parameters = array('user_auth' => array('user_name' => $user, 'password' => $mdp, 'version' => '1'), 'application_name' => 'SugarTest');
     $login_result = $client->call('login', $login_parameters);
     echo '<pre>';
     //get session id
     $session_id = $login_result['id'];
     $result = $proxy->seamless_login($session_id);
     // Ouverture de la session SuiteCRM
     header("Location: http://localhost/mysite/crm74/index.php?module=Administration&action=index&MSID={$session_id}");
 }
开发者ID:NyxAlexis,项目名称:SugarCRM-works,代码行数:38,代码来源:Router.php


示例15: buildOutput

/**
 * Created by PhpStorm.
 * User: André
 * Date: 01/04/2015
 * Time: 13:57
 */
function buildOutput($data, $debug = false)
{
    $log = Log::getInstance();
    $db = MysqliDb::getInstance();
    $output = array();
    if ($log->countErrors() > 0) {
        $errors = $log->getErrors();
    }
    $output = $data;
    if (isset($errors) && sizeof($errors) > 0) {
        $output['_ERROR_'] = $errors;
    }
    if ($debug == 'true') {
        $output['_DEBUG_'] = $log->getLogs();
    }
    echo json_encode($output, JSON_PRETTY_PRINT);
}
开发者ID:andrefedalto,项目名称:htv,代码行数:23,代码来源:functions.php


示例16: login

function login()
{
    $password = req('password');
    $username = req('username');
    $db = MysqliDb::getInstance();
    if ($password && $username) {
        $db->where('username', $username);
        if ($user = $db->getOne('users')) {
            if ($user['password'] == $password) {
                $auth = authcode("{$user['password']}\t{$user['uid']}", 'ENCODE');
                showjson('do_success', 0, array("auth" => rawurlencode($auth)));
            }
            showjson('password_error');
        }
    }
    showjson('login_error');
}
开发者ID:NaturalWill,项目名称:Simple-Healthcare-Consulting-System-API,代码行数:17,代码来源:user.php


示例17: checkauth

function checkauth()
{
    global $_SGLOBAL;
    $auth = req('auth');
    if ($auth) {
        $db = MysqliDb::getInstance();
        @(list($password, $uid) = explode("\t", authcode($auth, 'DECODE')));
        $_SGLOBAL['uid'] = intval($uid);
        if ($password && $_SGLOBAL['uid']) {
            $db->where('uid', $_SGLOBAL['uid']);
            if ($user = $db->getOne('users')) {
                if ($user['password'] == $password) {
                    $_SGLOBAL['usertype'] = $user['usertype'];
                    $_SGLOBAL['username'] = $user['username'];
                    return;
                }
            }
        }
    }
    showjson('to_login');
}
开发者ID:NaturalWill,项目名称:Simple-Healthcare-Consulting-System-API,代码行数:21,代码来源:common.php


示例18: comment

function comment()
{
    global $_SGLOBAL;
    checkauth();
    //验证登陆
    $op = req('op');
    $db = MysqliDb::getInstance();
    if ($op == 'add') {
        $setarr = array('uid' => $_SGLOBAL['uid']);
        $setarr['message'] = req('message');
        $setarr['zid'] = req('zid', 0);
        if ($setarr['message'] && $setarr['zid']) {
            $id = $db->insert('comment', $setarr);
            //插入数据
            if ($id) {
                showjson('do_success', 0, array("cid" => $id));
            }
            showjson('submit_comment_error');
        }
        showjson('zid_or_message_can_not_empty');
    } elseif ($op == 'del') {
        $cid = req('cid', 0);
        if (empty($cid)) {
            showjson('non_normal_operation');
        }
        $db->where('cid', $cid);
        if ($_SGLOBAL['usertype'] == 1) {
            //是否管理员
        } else {
            $db->where('uid', $_SGLOBAL['uid']);
        }
        $result = $db->delete('comment');
        //删除评论
        if ($result) {
            showjson('do_success', 0);
        }
        showjson('comment_not_exist');
    }
}
开发者ID:NaturalWill,项目名称:Simple-Healthcare-Consulting-System-API,代码行数:39,代码来源:submit.php


示例19: MysqliDb

<?php

require "../db.php";
$adminPage = true;
require "../../src/secure.php";
$db = new MysqliDb(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
if (empty($_POST['desc']) || empty($_POST['surface']) || empty($_POST['parking']) || empty($_POST['facilities'])) {
    header("Location: " . $baseurl . "admin/translate/?error=true&id=" . $_POST['id'] . "&lang=" . $_POST['lang']);
    exit;
}
$id = $_POST['id'];
$lang = $_POST['lang'];
$facilities = $_POST['facilities'];
$lighting = $_POST['lighting'];
$surface = $_POST['surface'];
$transit = $_POST['transit'];
$parking = $_POST['parking'];
$desc = rawurlencode($_POST['desc']);
$hours = $_POST['hours'];
$loopcount = $_POST['loopcount'];
$attractioncount = $_POST['attractioncount'];
$postaction = $_POST['postaction'];
$trans_id = $_POST['trans_id'];
$attractions = array();
$i = 0;
while ($i <= $attractioncount) {
    array_push($attractions, rawurlencode($_POST['attraction' . $i]));
    $i++;
}
$loops = array();
$i = 1;
开发者ID:jmayfiel,项目名称:prescriptiontrails,代码行数:31,代码来源:post.php


示例20: date_default_timezone_set

                <li>
                    <a href="about.html">About</a>
                </li>
            </ul>
        </div>
        <!-- /#sidebar-wrapper -->

        <!-- Page Content -->
        <div id="page-content-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1>Previous games</h1>
                        <?php 
date_default_timezone_set('UTC');
$db = new MysqliDb('localhost', 'root', '', 'golf-cards');
$cols = array("friendly_name", "max_round", "game_id ");
$result = $db->get("game_names", null, $cols);
?>
                            <table class="table table-striped">
                                <thead>
                                    <tr> 
                                        <th>Game Name</th>
                                        <th>Highest round played</th>
                                        <th>Date game was played</th>
                                    </tr>
                                </thead>
                                <tbody>                            
                                <?php 
for ($i = 0; $i < count($result); $i++) {
    ?>
开发者ID:starbuck93,项目名称:golf-card-game,代码行数:31,代码来源:Previous.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP N2Base类代码示例发布时间:2022-05-23
下一篇:
PHP Mysql类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap