Connection error: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) !DOCTYPE html> Tezztrax | PHP Data Objects

If your name's not down, you’re not getting in

One of the most important factors I discovered when building my log in system was security.

Making sure user accounts were protected by passwords was the first thing I researched. Luckily, ‘tezztrax’ is free to play so no financial information, personal details or other valuable information is needed. The only thing required for registration is an email address. Although many people will use a temporary email or spare address for registering on sites like ‘tezztrax’ (and that is often a good idea) I still wanted to protect all email addresses as best I could.

a chain link fence with a padlock across it
Security is paramount in any log in system

My answer came through the discovery of php PDO (PHP Data Objects) and to be honest, it took me an age to get my head around, but PHP Net was particularly useful as were the contributors on Stack Overflow. PDO is basically a way to interact with databases. It supports prepared statements which helps stop malicious access to databases. Prepared statements were just gobbledegook as far as I was concerned, but, as with most things, the more you persevere the easier it becomes.

The number of errors I was receiving was insane. Print_r became my best friend and eventually the errors decreased, at least for now. Constantly receiving error messages taught me how to logically troubleshoot problems, understand them and most importantly, fix them. You have to have patience, but trust me, it is worth it in the end.