Hey everybody I want to let you know that I have undertaken the grueling task of getting the heck away from WordPress. I was so sick of the problems and updates I had to do all the time. I am now using my ezbloo system and I am integrating all my old posts into the new system. It sucks, but in the end, I will save bundles of time. I needed to keep things simple and that is why I created ezbloo. I'll have more on this later for you guys after I am done with the total integration of my old posts here. So if you are looking for a post and need it faster, shoot me an email and I will make it a priority. [email protected]

In order to connect to a database you need to make a key file. Make a Config file to connect to MySql Database. This is a fairly simple process. You take the information that you assigned to a database when you granted privileges to it and make a  file and call it config.php. You can call the file whatever you want what is important is that you have the right login information to the database. Some people call their key file common.php or key.php. Here is the code that you will need for our examples that we will be doing in php. Put this code in your config.php file that you created with your FTP program..
$con = mysqli_connect("localhost","dbusername","dbpass","dbname");
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }else{
	  echo "";
  }
This is all you have to do to create a config file so that you can connect to a database. If you need to learn more about setting php variables and how they work please see PHP Variable When you make a config file to connect to MySql database you need to remember that this will be the key file that you will include on all your pages that you want dynamic content on. Dynamic content is different than static content in the sense that you are dynamically inserting content on a page from a database.

How to include the config file on pages.

After you make a config file to connect to MySql database you will need the following code to include on your dynamic pages.
include('config.php');
Now if you put your config file in a different directory or folder you would have to make sure that your path reflects it. In the example below we have a folder called key that we put our config file in.
include('key/config.php');
Be sure that you are aware of file paths, most of the time this is what gives newbies to PHP trouble because they confuse the URL path.

Video Instructions

https://youtu.be/CixD6dS7bqY