How to Connect a Website to a Simple Database Using PHP?

I watched this video here and want to build a simple database. Source code:

When I connect to my domain, I get the following error message whenever I type anything in: Connect Error (1045) Access denied for user ‘root’@’localhost’ (using password: NO)

i did exactly like the video did, except called my database IDK. What do I have to do to have values start showing up in my database? I already created a table, and I feel like I am missing something.