# How to add MySQL to website and where to put PHP file?

**URL:** https://forum.infinityfree.com/t/how-to-add-mysql-to-website-and-where-to-put-php-file/70677
**Category:** Hosting Support
**Created:** [January 7, 2023, 12:12pm UTC](https://forum.infinityfree.com/t/how-to-add-mysql-to-website-and-where-to-put-php-file/70677 "2023-01-07T12:12:17Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)
#### Post date: [January 7, 2023, 2:12pm UTC](https://forum.infinityfree.com/t/how-to-add-mysql-to-website-and-where-to-put-php-file/70677/2 "2023-01-07T14:12:58Z")

</div>

Those are a lot of questions, and many of them are not really suitable for a Q&A style format, and more of an in-depth tutorial or course.

In short, the guides you’ve read online are probably correct. You’ll just need to plug in the connection details (MySQL hostname, username, password, database name) and you can run your queries.

Please do note that our databases can only be accessed from code running on our servers, so you can’t test your PHP code (or Node.js) on your own computer with our database servers.

I think that this article may answer at least some of your questions:

> [@How to connect with MySQL](https://forum.infinityfree.com/t/how-to-connect-with-mysql/49340):
>
> Both the popular PDO and MySQLi libraries are available on all accounts and PHP versions, which are the libraries all (modern) scripts use to connect to a MySQL database. However, to use a database, you need to configure a few things first. Before you can use a database, you need to create the database first. You can create a database through your control panel in the section called MySQL Databases. Simply enter a desired name in the text box and click Create Database. To use the database with…

Your website files should be uploaded to the `htdocs` folder of your account. You can upload them with the file manager or with an FTP client of your choice (like FileZilla).

---

_[View the full topic](https://forum.infinityfree.com/t/how-to-add-mysql-to-website-and-where-to-put-php-file/70677)._
