I just started with PHP and my SQL databases, I have learned how to create databases, and create register forms that store the information on the databases, but I do not know how to keep people from being able to register with a user name that has already been taken, and I don't know how to allow users to have their own profile page on my website. Do you know how? I am using XAMPP to test my databases and PHP code on my local server, if that help in any way. Here is my PHP code:
<?php
$con=mysql_connect("localhost", "root", "" );
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$username=$_POST['username'];
$password=$_POST['password'];
$email=$_POST['email'];
mysql_select_db("test", $con);
mysql_query("INSERT INTO users (id, username, password, email)
VALUES (NULL,'$username', MD5('$password'), '$email')");
if (my_query)
echo "Account Successfully Created";
else
echo "Sorry Could Not Create Account !";
mysql_close($con);
?>