我在一天中尝试了几种不同的连接解决方案,但我一直在以某种方式遇到内部服务器错误500.
我已经创建了一个单独的connection.php文件,其代码如下所示:
(function() {
'use strict';
angular
.module('module1.route',['ui.router'])
.config(['$stateProvider', configRoute]);
function configRoute($stateProvider) {
$stateProvider
.state('module1', {
url: '/module1',
views: {
'': { // template to display in the main view
templateUrl: 'module1.html',
controller: 'Module1Controller as vm'
}
});
}
})();
但是,如果我尝试将以下代码添加到文档中,则会收到错误500:
$user = 'root';
$password = 'root';
$db = 'Vilduhelst';
$host = 'localhost';
$mysqli = new mysqli($host, $user, $password, $db);
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
有人知道为什么吗?