我無法得到這個代碼正確連接到數據庫:無法使用PHP
$connection=mysql_connect(db_server, db_user, db_pass);
if(!$connection)
{
die("Database Connection failed".mysql_error());
}
$db_select=mysql_select_db(db_name,$connection);
if(!$db_select)
{
die("Database Selection failed".mysql_error());
}
當我試圖腳本它說:
Parse error: syntax error, unexpected T_DNUMBER in /home/a8592246/public_html/pic/include/connect.php on line 3
如果posssible,任何人都可以複製和粘貼具有正確設置的代碼?
$mysql_host = "mysql16.000webhost.com";
$mysql_database = "a8592246_dbname";
$mysql_user = "a8592246_dbuser";
$mysql_password = "mypassword";
是什麼線路上無3? –