I am trying to write an authentication function and it doesn't seem to be working very well.
Here is the code I am using
function auth ($txtUser, $txtPass) {
$link = mysql_connect($dbhost, $dbuser, $dbpass);
$row = mysql_query("Select * from sc_auth.users where username = '$txtUser'", $link);
$result = mysql_fetch_array($row);
return $result[username];
};
What is wrong with my code?
I am assuming there is a problem with the $row = mysql_query("Select * from sc_auth.users where username = '$txtUser'", $link);
Thanks a lot for the help. =D