解析エラー: 構文エラー、予期しない T_VARIABLE /home/content/00/7882800/html/Connections/dueslogin.php の 4 行目
Godaddy データベースに接続しようとしていますが、php エラーのため接続できません。
<?php
//Variables for connecting to your database.
//These variable values come from your hosting account.
$hostname = "Squarepants.db.7882800.hostedresource.com";
$username = "Squarepants";
$dbname = "Squarepants";
//These variable values need to be changed by you before deploying
$password = "***********";
$usertable = "Spongebob";
$username = "username";
$password = "password";
//Connecting to your database
mysql_connect($hostname, $username, $password) OR DIE ("Unable to
connect to database! Please try again later.");
mysql_select_db($Squarepants);
//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>";
}
}
?>