本文整理汇总了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');
示例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());