本文整理汇总了PHP中MySQL::table方法的典型用法代码示例。如果您正苦于以下问题:PHP MySQL::table方法的具体用法?PHP MySQL::table怎么用?PHP MySQL::table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MySQL
的用法示例。
在下文中一共展示了MySQL::table方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$loader->setConfigs($configs);
$class_list = array('Smarty', 'Logs', 'MySQL', 'Code', 'JSSDK', 'WechatResponse');
$loader->includeClass($class_list);
$script_list = array('configs', 'functions', 'lang', 'member', 'transaction', 'wechat');
$loader->includeScript($script_list);
//初始化数据库链接
global $db;
$db = new MySQL(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DBNAME, DB_PREFIX);
$debug_mode = true;
//开启此项将关闭Smarty缓存模式,并开启日志跟踪
//初始化日志对象
global $log;
$log_file = date('Ymd') . '.log';
$log = new Logs($debug_mode, $log_file);
//读取网站设置
$get_sysconf = 'select `key`,`value` from ' . $db->table('sysconf');
global $config;
$config_tmp = $db->fetchAll($get_sysconf);
foreach ($config_tmp as $tmp) {
$config[$tmp['key']] = $tmp['value'];
}
//初始化smarty对象
global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(ROOT_PATH . 'data/compiles');
$smarty->setTemplateDir(ROOT_PATH . 'themes/' . $config['themes']);
$smarty->setCacheDir(ROOT_PATH . 'data/caches');
$smarty->setCacheLifetime(2);
//设置缓存文件超时时间为1800秒
//Debug模式下每次都强制编译输出
if ($debug_mode) {
示例2: array
$loader->setConfigs($configs);
$class_list = array('Smarty', 'Logs', 'MySQL', 'Code', 'PHPExcel');
$loader->includeClass($class_list);
$script_list = array('configs', 'functions', 'lang', 'purview', 'member', 'account', 'wechat');
$loader->includeScript($script_list);
//初始化数据库链接
global $db;
$db = new MySQL(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DBNAME, DB_PREFIX);
$debug_mode = true;
//开启此项将关闭Smarty缓存模式,并开启日志跟踪
//初始化日志对象
global $log;
$log_file = date('Ymd') . '.log';
$log = new Logs($debug_mode, $log_file);
//读取网站设置
$get_sysconf = 'select `key`,`value` from ' . $db->table('sysconf');
global $config;
$config_tmp = $db->fetchAll($get_sysconf);
foreach ($config_tmp as $tmp) {
$config[$tmp['key']] = $tmp['value'];
}
//初始化smarty对象
global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(ROOT_PATH . 'control/data/compiles');
$smarty->setTemplateDir(ROOT_PATH . 'control/themes/');
$smarty->setCacheDir(ROOT_PATH . 'control/data/caches');
$smarty->setCacheLifetime(1800);
//设置缓存文件超时时间为1800秒
//Debug模式下每次都强制编译输出
if ($debug_mode) {
示例3: MySQL
<?php
header("content-type:text/html;charset:utf-8");
require_once 'mysql.class.php';
$mysql = new MySQL('localhost', 'user', 'password', 'test');
echo '<pre>';
//获取表字段
//print_r($mysql->getFields('test'));
//增
echo $mysql->data(array('name' => 'test', 'password' => '123456'))->table('test')->add();
//删
echo $mysql->table('test')->where('id=1')->delete();
//改
echo $mysql->table('test')->data(array('name' => 'bbbbbbbbbbbb'))->where('id<3')->update();
//查
print_r($mysql->table('test')->where('id=4')->select());
print_r($mysql->table('test')->order('id desc')->select());
//
$mysql->query('select * from `test`');
$mysql->execute('update `test` set password = 123');
echo '</pre>';
echo '查询次数:' . $mysql->query_count . '<br>';
echo '查询时间:' . number_format(microtime(true) - $mysql->query_start_time, 10) . ' 秒<br>';
echo '错误信息:' . $mysql->error() . '<br>';
示例4: array
$loader->setConfigs($configs);
$class_list = array('Smarty', 'Logs', 'MySQL', 'Code');
$loader->includeClass($class_list);
$script_list = array('configs', 'functions', 'lang', 'purview', 'content', 'section', 'statistics');
$loader->includeScript($script_list);
//初始化数据库链接
global $db;
$db = new MySQL(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DBNAME, DB_PREFIX);
$debug_mode = true;
//开启此项将关闭Smarty缓存模式,并开启日志跟踪
//初始化日志对象
global $log;
$log_file = date('Ymd') . '.log';
$log = new Logs($debug_mode, $log_file);
//读取网站设置
$get_sysconf = 'select `key`,`value` from ' . $db->table('sysconf');
global $config;
$config_tmp = $db->fetchAll($get_sysconf);
if ($config_tmp) {
foreach ($config_tmp as $tmp) {
$config[$tmp['key']] = $tmp['value'];
}
}
//初始化smarty对象
global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(ROOT_PATH . 'data/compiles');
$smarty->setTemplateDir(ROOT_PATH . 'themes/' . $config['themes']);
$smarty->setCacheDir(ROOT_PATH . 'data/caches');
$smarty->setCacheLifetime(1800);
//设置缓存文件超时时间为1800秒
示例5: array
$loader->setConfigs($configs);
$class_list = array('Smarty', 'Logs', 'MySQL', 'Code');
$loader->includeClass($class_list);
$script_list = array('configs', 'functions', 'lang', 'business', 'transaction', 'member');
$loader->includeScript($script_list);
//初始化数据库链接
global $db;
$db = new MySQL(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DBNAME, DB_PREFIX);
$debug_mode = true;
//开启此项将关闭Smarty缓存模式,并开启日志跟踪
//初始化日志对象
global $log;
$log_file = date('Ymd') . '.log';
$log = new Logs($debug_mode, $log_file);
//读取网站设置
$get_sysconf = 'select `key`,`value` from ' . $db->table('sysconf');
global $config;
$config_tmp = $db->fetchAll($get_sysconf);
foreach ($config_tmp as $tmp) {
$config[$tmp['key']] = $tmp['value'];
}
//初始化smarty对象
global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(ROOT_PATH . 'pc/data/compiles');
$smarty->setTemplateDir(ROOT_PATH . 'pc/themes/' . $config['themes']);
$smarty->setCacheDir(ROOT_PATH . 'pc/data/caches');
$smarty->setCacheLifetime(1800);
//设置缓存文件超时时间为1800秒
//Debug模式下每次都强制编译输出
if ($debug_mode) {