I have a code where I am inserting a new record into a database. I need a way of redirecting the user if they have already entered their information into the database. Here is my php code...how would I modify this to check for an existing record based on their entered username/email??
<? $passwordretype=$_POST['passwordretype']; $Username=$_POST['email']; $Password=$_POST['password']; mysql_connect("localhost", "xxxxxx", "tytytyty") or die(mysql_error()); mysql_select_db("xxxxxx") or die(mysql_error()); mysql_query("INSERT INTO `xxxx` VALUES ('$Username', '$Password' )"); ?>
also I need a way to check if the $passwordretype = the $Password.
are there any simple fixes???