
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.46 KB | hits: 13 | expires: Never
//create and issue the query
$sql = "select f_name, l_name from auth_admin where username = '$_POST[username]' AND password = password('$_POST[password]')";
$result = mysql_query($sql,$conn) or die(mysql_error());
//get the number of rows in the result set; should be 1 if a match
if (mysql_num_rows($result) == 1) {
//if authorized, get the values of f_name l_name
$f_name = mysql_result($result, 0, 'f_name');
$l_name = mysql_result($result, 0, 'l_name');