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


PHP adoSchema::SetPrefix方法代码示例

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


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

示例1: adoSchema

            } else {
                echo_success("Good, database \"<b>{$db_name}</b>\" has been created!!");
                //Reconnect. Hrmm, this is kinda weird.
                $db->Connect($db_host, $db_user, $db_password, $db_name);
            }
        }
        break;
    default:
        echo_normal("Sorry, <b>setup.php</b> currently does not fully support \"<b>{$db_type}</b>\" databases.\n\t\t\t\t\t<br>I'm assuming you've already created the database \"{$db_name}\", attempting to create tables.\n\t\t\t\t\t<br> Please email <b>{$author_email}</b> code to detect if a database is created or not so full support for \"<b>{$db_type}</b>\" can be added.");
}
/*
 * Attempt to create tables
 */
// Create the schema object and build the query array.
$schema = new adoSchema($db);
$schema->SetPrefix($db_table_prefix, FALSE);
//set $underscore == FALSE
// Build the SQL array
$schema->ParseSchema('schema.xml');
// maybe display this if $gacl->debug is true?
if ($gacl->_debug) {
    print "Here's the SQL to do the build:<br />\n<code>";
    print $schema->getSQL('html');
    print "</code>\n";
    // exit;
}
// Execute the SQL on the database
#ADODB's xmlschema is being lame, continue on error.
$schema->ContinueOnError(TRUE);
$result = $schema->ExecuteSchema();
if ($result != 2) {
开发者ID:GeraldScott,项目名称:OpenEvSys,代码行数:31,代码来源:setup.php

示例2: adoSchema

            } else {
                echo_success("Good, database \"<b>{$db_name}</b>\" has been created!!");
                //Reconnect. Hrmm, this is kinda weird.
                $db->Connect($db_host, $db_user, $db_password, $db_name);
            }
        }
        break;
    default:
        echo_normal("Sorry, <b>setup.php</b> currently does not fully support \"<b>{$db_type}</b>\" databases.\n\t\t\t\t\t<br>I'm assuming you've already created the database \"{$db_name}\", attempting to create tables.\n\t\t\t\t\t<br> Please email <b>{$author_email}</b> code to detect if a database is created or not so full support for \"<b>{$db_type}</b>\" can be added.");
}
/*
 * Attempt to create tables
 */
// Create the schema object and build the query array.
$schema = new adoSchema($db);
$schema->SetPrefix($db_table_prefix);
// Build the SQL array
$schema->ParseSchema('schema.xml');
// maybe display this if $gacl->debug is true?
if ($gacl->_debug) {
    print "Here's the SQL to do the build:<br />\n<code>";
    print $schema->getSQL('html');
    print "</code>\n";
    // exit;
}
// Execute the SQL on the database
#ADODB's xmlschema is being lame, continue on error.
$schema->ContinueOnError(TRUE);
$result = $schema->ExecuteSchema();
if ($result != 2) {
    echo_failed('Failed creating tables. Please enable DEBUG mode (set it to TRUE in $gacl_options near top of admin/gacl_admin.inc.php) to see the error and try again. You will most likely need to delete any tables already created.');
开发者ID:klr2003,项目名称:sourceread,代码行数:31,代码来源:setup.php

示例3: strtolower

 function _upgrade_database($table_prefix)
 {
     $dbcon = AMP_Registry::getDbcon();
     $table_names = $dbcon->MetaTables();
     $target_table = strtolower($table_prefix . 'phpgacl');
     if (array_search($target_table, $table_names) !== FALSE) {
         return true;
     }
     require_once 'adodb/adodb-xmlschema.inc.php';
     $schema = new adoSchema($dbcon);
     $schema->SetPrefix($table_prefix, FALSE);
     $schema->ParseSchema(AMP_BASE_INCLUDE_PATH . 'phpgacl/schema.xml');
     $schema->ContinueOnError(TRUE);
     $result = $schema->ExecuteSchema();
     if ($result == 2) {
         $this->message('Database upgraded successfully');
     } else {
         $this->error('Database upgrade failed');
     }
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:20,代码来源:Controller.php


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