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


PHP MysqliDb::setPrefix方法代码示例

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


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

示例1: build_link_list

        $output .= '/>';
    }
    return $output;
}
function build_link_list($list)
{
    if ($list) {
        foreach ($list as $key => $val) {
            if ($val['img_path']) {
                $img = '<img src="' . $val['img_path'] . '" alt="' . $val['title'] . '" /> ';
            } else {
                $img = '';
            }
            if (substr($val['url'], 0, 4) != 'http') {
                $val['url'] = 'http://' . $val['url'];
            }
            $output .= '<li>' . build_hyperlink($val['url'], '', '', $img . $val['title']) . '</li>' . "\n";
        }
    }
    return $output;
}
/* ! Load classes * * * * * * * */
require_once DIR_SYSTEM . 'MysqliDb.php';
$_db = new MysqliDb($setup['db_host'], $setup['db_user'], $setup['db_pswd'], $setup['db_name']);
$_db->setPrefix('grlx_');
if (!$_db) {
    die('<h1>Holy null records, Batman! The database is missing!</h1><p>Even worse, Robin, the first-run installation script is gone. This is a critical error. <a href="http://twitter.com/grawlixcomix">Better call for backup</a>.</p>');
}
spl_autoload_register(null, false);
spl_autoload_extensions('.php');
spl_autoload_register('grlx_load');
开发者ID:UTSquishy,项目名称:Grawlix-Repository,代码行数:31,代码来源:init.inc.php

示例2: MysqliDb

<?php

require_once 'vendor/autoload.php';
require_once 'config/settings.php';
include 'functions.php';
//read input data
$data = json_decode(file_get_contents('php://input'), true);
if ($data == null || $data == "" || !isset($data['message'])) {
    die;
}
$db = new MysqliDb(HOST, DB_USER, DB_PASSWORD, DATABASE);
$db->setPrefix('soft_');
$text = '';
$chatid = '';
try {
    //catch user info
    $chatid = $data['message']['chat']['id'];
    $first_name = isset($data['message']['chat']['first_name']) ? $data['message']['chat']['first_name'] : '';
    $last_name = isset($data['message']['chat']['last_name']) ? $data['message']['chat']['last_name'] : '';
    $username = isset($data['message']['chat']['username']) ? $data['message']['chat']['username'] : '';
    $db->insert('users', array('ID' => $chatid, 'first_name' => $first_name, 'last_name' => $last_name, 'username' => $username));
    //catch message data
    $text = $data['message']['text'];
    $messageid = $data['message']['message_id'];
    $updateid = $data['update_id'];
    $senderid = $data['message']['from']['id'];
    $date = $data['message']['date'];
    $messageid = $data['message']['message_id'];
    $db->insert('received', array('ID' => $username, 'Message_id' => $messageid, 'User_id' => $senderid, 'Date' => $date, 'Text' => $text));
} catch (Exception $e) {
    error_log("خطا در دریافت اطلاعات\n\n" . $e->getMessage());
开发者ID:hoseinBL,项目名称:SoftwareTalks,代码行数:31,代码来源:index.php


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