Commit 6d65997f authored by Evangelos Foutras's avatar Evangelos Foutras 🐱 Committed by Loui Chang
Browse files

Add uid_from_email(), similar to uid_from_username



Signed-off-by: default avatarLoui Chang <louipc.ist@gmail.com>
parent 6ee8b88c
......@@ -400,7 +400,26 @@ function uid_from_username($username="")
return "None";
}
$row = mysql_fetch_row($result);
return $row[0];
}
# obtain the uid given a Users.Email
#
function uid_from_email($email="")
{
if (!$email) {
return "";
}
$dbh = db_connect();
$q = "SELECT ID FROM Users WHERE Email = '".mysql_real_escape_string($email)
."'";
$result = db_query($q, $dbh);
if (!$result) {
return "None";
}
$row = mysql_fetch_row($result);
return $row[0];
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment