Php MySQL数据库连接错误

Php MySQL数据库连接错误,php,mysql,Php,Mysql,使用以上代码,一切都已设置,但 关于checkcredts.php 分析错误:语法错误,第33行的C:\xampp\htdocs\cnr\Connection.php中出现意外的“$\u Connection”T\u变量,请尝试: 替换 ` <?php /* Connection PHP file! Edit this to properly connect to your MySQL! Copyright © 2011, 2012 Quin Schurman This p

使用以上代码,一切都已设置,但 关于checkcredts.php 分析错误:语法错误,第33行的C:\xampp\htdocs\cnr\Connection.php中出现意外的“$\u Connection”T\u变量,请尝试:

替换

`    <?php
/*

Connection PHP file! Edit this to properly connect to your MySQL!



Copyright © 2011, 2012 Quin Schurman

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.
*/

$_Host = "**.***.***.**";
$_User = "*****";
$_Pass = "****";

$_Database = "cnr";

$_UsersTable = "playerdata"

//Connect to MySQL using mysql_connect()
$_Connection = mysql_connect($_Host, $_User, $_Pass) or die('Could not connect to $_Host with $_User using password $_Pass');

//Select the database defined in $_Database.
mysql_select_db($_Database);

?>`


并添加;在$\u UsersTable=playerdata之后,只需添加;在$\u UsersTable=playerdata$\u UsersTable=playerdata之后,这里缺少一个分号,请在发布代码时删除与问题不直接相关的任何内容。那份版权声明只会让人分心。看到C 2012,代码大概在四年多的时间里没有打补丁,这并不令人鼓舞。警告:如果你只是在学习PHP,请不要学习过时的接口。这很糟糕,已经在PHP7中删除了。替换类和指南类有助于解释最佳实践。请确保您的用户参数是正确的,否则将导致严重的错误。您看到的是一个语法错误…不是mysql\u connect错误..对不起,我正在学习php:除非您有很好的理由,否则不要使用错误抑制@operator。此外,单引号字符串不会插值。第三,不要将用户名、主机和密码等敏感信息放在用户看到的错误消息中。这就是死亡的作用。
$_Connection = mysql_connect($_Host, $_User, $_Pass) or die('Could not connect to $_Host with $_User using password $_Pass');
@mysql_connect($_Host, $_User, $_Pass) or die('Could not connect to $_Host with $_User using password $_Pass');