使用php,xampp连接到数据库

I'm not sure where I'm supposed to save my .php file, because I saved it in a custom folder, but I'm pretty sure it's not right since I get this error when I go to localhost/connect.php

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404

localhost Apache/2.4.9 (Win32) OpenSSL/1.0.1g PHP/5.5.11

All your files for XAMPP, should be saved in htdocs.

For example, if your installation is in C:\xampp\ then C:\xampp\htdocs. It could be accessed by http://localhost/.

Create a folder htdocs\db, then access like http://localhost/db/connect.php

your path name should like

localhost/yourfoldername/connect.php

here yourfoldername is the name of your folder you created inside htdocs

Your root folder is xampp/htdocs/ whenever you go to localhost from your browser, it is referencing that root folder... save your files inside htdocs