hi guys I am i am sorry to be a bother but i am new to php and I am currently in the process of creating, login and register pages that store a users name and password in to a database but I am finding it hard to source any code to check if the name exists and if it does tell the user that it does and that they have to choose a alternative user name. The code I have for updating the database is:
<?php
extract ($_POST);
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("firstone", $con);
$username = $_POST['username'];
$password = $_POST['password'];
// just to show the collection and storage of information from the form
mysql_query("INSERT INTO details (username , password) VALUES ('$username', '$password')");
echo "your account has been created click next to continue";
mysql_close($con);
?>