I'm trying to code a log in and registration feature but I'm having trouble connecting to my MySQL server, I'm sure all my credentials are correct, just not sure I've applied them correctly.
I named both the database and username the same as an example, still no connection. It wants to connect to a table in the database called 'users'.
Thanks a lot.
Connection code:
PHP Code:
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if ($username && $password) {
$connect = mysql_connect("mysql16.000webhost.com", "a6128086_users", "password") or die ("Couldn't connect!");
mysql_select_db("a6128086_users", $connect) or die("Unable to locate database.");
}
else
die("Please enter a Username and Password.");
?>