ページが要求されたときにデータベースを変更する php スクリプトがあります。これがphpです:
<?php
date_default_timezone_set('EST');//set time zone
$con=mysqli_connect("baukin.fatcowmysql.com","sas","***pass***","dbname");//establish connection
// Check connection
if (mysqli_connect_errno())//ping database to check connection
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();//error message
}
else
{
echo "Successfully updated database";//success message
}
mysqli_query($con,"UPDATE dryers SET STATE='$_GET[state]' WHERE MACHINEID ='$_GET[machine_id]' ");//update state
mysqli_query($con,"UPDATE dryers SET UPDATETIME=date('m/d/y H:i:s') WHERE MACHINEID = '$_GET[machine_id]' ");//update time
mysqli_close($con);//close connection
?>
次のエラーが表示されます。
Warning: mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host 'server' (0) in /home/content/57/10410357/html/updatedatabase.php on line 3
Failed to connect to MySQL: Unknown MySQL server host 'server' (0)
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/content/57/10410357/html/updatedatabase.php on line 13
Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/content/57/10410357/html/updatedatabase.php on line 15
Warning: mysqli_close() expects parameter 1 to be mysqli, boolean given in /home/content/57/10410357/html/updatedatabase.php on line 17
私はphpを初めて使用しますが、その理由は何ですか?