我试图连接到我的数据库并显示此错误。我正在为我的数据库使用付费服务器。
function connect_to_database()
{
$username = "treq";
$password = "treq";
$hostname = "89.46.2.250";
$database = "tr";
$con = mysqli_connect($username, $password, $hostname, $database) or die ("Connecting to MySQL failed");
return $con;
}
答案 0 :(得分:1)
您混合了连接参数,请参阅http://www.php.net/manual/en/mysqli.construct.php
function onEachFeature(feature, layer) {
var popupContent = "<p>I started out as a GeoJSON "
+ feature.geometry.type + ", but now I'm a Leaflet vector!</p>";
//////////////////////////////////////////////////////////////
// popupContent property to actual popup
//////////////////////////////////////////////////////////////
if (feature.properties && feature.properties.popupContent) {
popupContent += feature.properties.popupContent;
}
layer.bindPopup(popupContent);
//////////////////////////////////////////////////////////////
}
第一个参数是主机名,然后是用户名和密码。