我不知道我错过了什么。我确信我错过了一些简单的事情:
以下是脚本:
// Verify that the old password is correct
// Connect to server and select databse.
mysql_connect("$host", "$sqlusername", "$sqlpassword")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Check to see if the old password is valid
$sql = "select * from $tbl_name where username = '$username' and password = '$oldpassword'";
$result = mysql_query($sql);
$count=mysql_num_rows($result);
if ($count == 1) {
// Once oldpassword's validity has been proven move on to the change password script
$sql="INSERT INTO members (password, passchangedate)
VALUES
('$newpassword1', '$today')";
};
产生此错误:
警告:mysql_query():提供的参数不是......中的有效MySQL-Link资源。
我确信我只是在做一些愚蠢的事。我是php的新手,但是我已经被困了很长时间,所以我觉得发帖不太合适。