同じエラー メッセージが表示され続ける (警告: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/) 00/7882800/html/Connections/dueslogin.php 27 行目 データベースに接続できません!後でもう一度お試しください。)
<?php
//Variables for connecting to your database.
//These variable values come from your hosting account.
$hostname = "TarHeelsDues.db.7882800.hostedresource.com";
$username = "TarHeelsDues";
$dbname = "TarHeelsDues";
//These variable values need to be changed by you before deploying
$password = "************";
$usertable = "DuesLogin";
$yourfield = "your_field";
//Connecting to your database
mysql_connect($hostname, $dbname, $password) OR DIE ("Unable to
connect to database! Please try again later.");
mysql_select_db($TarHeelsDues);
//Fetching from your database table.
$query = "SELECT * FROM $usertable";
$result = mysql_query($query);
if ($result) {
while($row = mysql_fetch_array($result)) {
$name = $row["$yourfield"];
echo "Name: $name<br>";
}
}
?>