Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 1st, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //create and issue the query
  2. $sql = "select f_name, l_name from auth_admin where username = '$_POST[username]' AND password = password('$_POST[password]')";
  3. $result = mysql_query($sql,$conn) or die(mysql_error());
  4.  
  5. //get the number of rows in the result set; should be 1 if a match
  6. if (mysql_num_rows($result) == 1) {
  7.    //if authorized, get the values of f_name l_name
  8.    $f_name = mysql_result($result, 0, 'f_name');
  9.    $l_name = mysql_result($result, 0, 'l_name');