 <p>Obviously the answer is in your error. You didn't select any database. When using this function mysqli_connect specify the database you want to connect to.</p> <p>Here is the syntax of the function: <a href="http://www.w3schools.com/Php/func_mysqli_connect.asp" rel="nofollow">http://www.w3schools.com/Php/func_mysqli_connect.asp</a> .</p> <p>1) Create your database outside of your application</p> <p>2) Specify mysqli_connect with the database you want to select.</p> <p>You can also use another function called mysqli_select_db . You can find the sytanx here : <a href="http://www.w3schools.com/php/func_mysqli_select_db.asp" rel="nofollow">http://www.w3schools.com/php/func_mysqli_select_db.asp</a> .</p> <p>As already stated in the comment, you will also have to replace : "example.com" with your ip address, if you are running locally replace it with 127.0.0.1:3306 , if you didn't change the port when you installed your mysql database / "johndoe" with your database account, you can change that to "root" / "abc123" with your root account password DEFAULT : "" . </p> <p>Good luck !</p>