PHP function mysqli_fetch_assoc () – Fetch the next row of a result set as an associative array
$fetch= mysqli_query($connect, $sql);
$row = mysqli_fetch_assoc($fetch);
$id = $row['userID'];
$pass = $row['password'];
Select password from table users by email
$sql = "SELECT password FROM users WHERE email = '".htmlspecialchars( $_POST['email'] )."'";
$result = mysqli_query($con, $sql);
while( $row = mysqli_fetch_assoc($result) ) {
$new_pass = $row['password'];
}