Как мне заставить регистрационную форму работать
Hi, So I have a register form in which I keep receiving this error for: Fatal error: Uncaught Error: Using $this when not in object context in /homepages/33/d706589573/htdocs/Project/dbConnect.php:10 Stack trace: #0 /homepages/33/d706589573/htdocs/Project/help.php(35): include() #1 {main} thrown in /homepages/33/d706589573/htdocs/Project/dbConnect.php on line 10 This is the code from my db.connect file: <?php try { $conn = new PDO("mysql:host=$host_name;db name=$database",$user_name,$password); //set the PDO error mode to exception $conn->setAttrribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "connection to MYSQL sever successfully established!"; } catch(PDOException $e) { echo"Connection failed: ".$e->getMessage(); } The line which Is bold is the line I am getting an error on, has anyone any idea how I can fix this error?
Что я уже пробовал:
Я пробовал альтернативный код, но до сих пор не решил эту проблему