本文整理匯總了PHP中SqlParser::connect方法的典型用法代碼示例。如果您正苦於以下問題:PHP SqlParser::connect方法的具體用法?PHP SqlParser::connect怎麽用?PHP SqlParser::connect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SqlParser
的用法示例。
在下文中一共展示了SqlParser::connect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: realpath
} else {
echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>";
}
}
// open db connection
$setupPath = realpath(dirname(__FILE__));
include "{$setupPath}/setup.info.php";
include "{$setupPath}/sqlParser.class.php";
$sqlParser = new SqlParser($database_server, $database_user, $database_password, str_replace("`", "", $dbase), $table_prefix, $adminname, $adminemail, $adminpass, $database_connection_charset, $managerlanguage, $database_connection_method);
$sqlParser->mode = $installMode < 1 ? "new" : "upd";
//$sqlParser->imageUrl = 'http://' . $_SERVER['SERVER_NAME'] . $base_url . "assets/";
$sqlParser->imageUrl = "assets/";
$sqlParser->imagePath = $base_path . "assets/";
$sqlParser->fileManagerPath = $base_path;
$sqlParser->ignoreDuplicateErrors = true;
$sqlParser->connect();
// install/update database
echo "<p>" . $_lang['setup_database_creating_tables'];
if ($moduleSQLBaseFile) {
$sqlParser->process($moduleSQLBaseFile);
// display database results
if ($sqlParser->installFailed == true) {
$errors += 1;
echo "<span class=\"notok\"><b>" . $_lang['database_alerts'] . "</span></p>";
echo "<p>" . $_lang['setup_couldnt_install'] . "</p>";
echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />";
for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) {
echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />";
}
echo "</p>";
echo "<p>" . $_lang['some_tables_not_updated'] . "</p>";