Entry
How do I get a return that lets me know that a depulicate exists and cannot be inserted in mySQL using PHP?
Sep 6th, 2003 01:42
Chukwuma Uzoma-Nze, Jeff Guy,
I am going to use the example of inserting crypted passwords into a
MySQL database:
you simply verify the user inputed password "$usr_pwd" against the
databse password "$db_pwd" and if they match you proceed:
$query = mysql_query("select pwd from auth where pwd = "$usr_pwd" ",
$conn);
$queryArray = mysql_fetch_array($query);
//$queryArray[0] will be your result u can echo it!
$db_pwd = $queryArray[0]; //You can put "$queryArray[0]" directly
//into the statement if u wish, I do!
if(isset($db_pwd)
{
return true
}
elseif(empty($db_pwd))
{
return false
}