本文整理汇总了PHP中sql_db::get_sql_layer方法的典型用法代码示例。如果您正苦于以下问题:PHP sql_db::get_sql_layer方法的具体用法?PHP sql_db::get_sql_layer怎么用?PHP sql_db::get_sql_layer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sql_db
的用法示例。
在下文中一共展示了sql_db::get_sql_layer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: substr
$phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path = './../';
include $phpbb_root_path . 'config.' . $phpEx;
require $phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx;
require $phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx;
include $phpbb_root_path . 'includes/functions.' . $phpEx;
$cache = new acm();
$db = new sql_db();
// Connect to DB
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
// Rename the attachments table...
$sql = "RENAME TABLE {$table_prefix}attachments TO {$table_prefix}attach_temp";
$db->sql_query($sql);
$sql = "CREATE TABLE {$table_prefix}attachments \n\tSELECT d.*, a.post_id, a.user_id_from as poster_id, p.topic_id\n\t\tFROM {$table_prefix}attach_desc d, {$table_prefix}attach_temp a, {$table_prefix}posts p\n\t\tWHERE a.attach_id = d.attach_id\n\t\t\tAND a.post_id = p.post_id";
$db->sql_query($sql);
switch ($db->get_sql_layer()) {
case 'mysql':
case 'mysql4':
$sql = 'ALTER TABLE ' . $table_prefix . 'attachments
ADD PRIMARY KEY (attach_id),
ADD INDEX filetime (filetime),
ADD INDEX post_id (post_id),
ADD INDEX poster_id (poster_id),
ADD INDEX physical_filename (physical_filename(10)),
ADD INDEX filesize (filesize),
ADD INDEX topic_id (topic_id),
MODIFY COLUMN attach_id mediumint(8) UNSIGNED NOT NULL auto_increment';
break;
case 'mssql':
case 'mssql-odbc':
case 'msaccess':