我有这段代码,我试图将 $current 与 $password 进行比较,后者是数组,甚至认为两者具有相同的值并且不起作用。
$current_password = mysqli_query($db_connection,"SELECT password FROM
user WHERE username = 'sanket' ");
$row = mysqli_fetch_array($current_password);
foreach($row as $pass)
{
$password = $pass[0];
}
$current = $_POST['old_password'];
if ($current == $password) {
if ($_POST['new_password'] == $_POST['confirm_password']) {
mysqli_query($db_connection,"UPDATE user SET password
= ".$_POST['confirm_password']." WHERE username = 'sanket'") ;
}