Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
分析错误:语法错误,意外';试试';(T_TRY)在第8行的/customers/d/4/1/imanity.de/httpd.www/register.php中_Php_Mysql - Fatal编程技术网

分析错误:语法错误,意外';试试';(T_TRY)在第8行的/customers/d/4/1/imanity.de/httpd.www/register.php中

分析错误:语法错误,意外';试试';(T_TRY)在第8行的/customers/d/4/1/imanity.de/httpd.www/register.php中,php,mysql,Php,Mysql,您好,所以我遵循了youtube教程,因为这是我第一次尝试,现在我遇到了一个错误,我检查了所有内容,但我没有得出结论,为什么连接db不起作用 <?php $server = 'imanity.de.mysql'; $username = 'imanity_de'; $password = '*********'; $database = 'imanity_de'; try{ $conn = new PDO("mysql:host=$server;dbname=$databa

您好,所以我遵循了youtube教程,因为这是我第一次尝试,现在我遇到了一个错误,我检查了所有内容,但我没有得出结论,为什么连接db不起作用

<?php

 $server = 'imanity.de.mysql';
 $username = 'imanity_de';
 $password = '*********';
 $database = 'imanity_de';

 try{
 $conn = new PDO("mysql:host=$server;dbname=$database;", $username, $password);
 }

 catch(PDDException $e){
 die("Connection failed: " . $e->getMessage());
 }

 if (!empty($_POST['email']) && !empty($_POST['password'])):

// Enter the new user in the database

endif;

?>


您的意思是您收到了本文标题中显示的语法错误消息吗?您的代码看起来很好,似乎没有触发该错误消息

好吧,我想我发现了我的错误,我把所有东西都打包在一个名为“auth”的文件夹中,只上传了里面的数据。必须将其放入名为“auth”的文件夹中,因为在访问我的页面之前,每个人都必须将“imanity.de/auth”放入其中


对不起,我错了,谢谢你们的帮助

这段代码没有这样的语法错误。你确定这是被调用的register.php吗?我将错误消息上载到了“”,你也可以查看“www.imanity.de”,单击register,应该会显示错误消息。。。。