Copy CodeThe code is as follows:
$uname =$_post["username"];
$pwd =$_post["Password"];
$link = mysql_connect (' localhost ', ' root ', ' 123456 ')
Or Die (' Could not connect: '. Mysql_error ());
mysql_select_db (' Ruida ') or Die (' Could not select database ');
Execute SQL Query
$query = ' SELECT * from user ';
$result = mysql_query ($query) or Die (' Query failed: '. mysql_error ());
while ($row =mysql_fetch_array ($result)) {
if ($uname = = $row [' username '] && $pwd = = $row [' Password '])
{
Page Jump
}
Else
Echo ' error! ';}
Releasing the result set
Mysql_free_result ($result);
Close connection
Mysql_close ($link);
?>
http://www.bkjia.com/PHPjc/321444.html www.bkjia.com true http://www.bkjia.com/PHPjc/321444.html techarticle Copy the code as follows: PHP $uname =$_post["username"]; $pwd =$_post["password"]; $link = mysql_connect (' localhost ', ' root ', ' 123456 ') or Die (' Could not connect: '. Mysql_error ( ...