Hello Everyone, this is my first post here so I hope to get some help with a problem that’s probably a simple fix. I am relatively new at writing PHP.
I am writing code for a log in and register system. Using WAMP for the server side with username root and no pass(default). I keep getting this error when I go to the page.
SQLSTATE[HY000] [1045] Access denied for user ‘root’@‘localhost’ (using password: NO)
It has something to do with the code for my connect. php file
[php]
<?php $server = "localhost"; $username = 'root'; $password = ''; $database = 'users'; try{ $conn = new PDO("mysql:host=$server;dbname=$database", $username , $password); } catch(PDOException $e){ die("Connection Failed: " . $e->getMessage()); } ?>[/php]
any help I can get is really appreciated.