Unable to AES_DECRYPT after AES_ENCRYPT in mysql

前端 未结 4 562
遇见更好的自我
遇见更好的自我 2020-11-27 05:45

I created user table

CREATE  TABLE `user` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
`first_name` VARBINARY(100) NULL ,
`address` VARBINARY(200) NOT N         


        
4条回答
  •  抹茶落季
    2020-11-27 06:42

    if (isset($_POST['user_name']) and isset($_POST['user_password'])){
    
    $user_name = $_POST['user_name'];
    $user_password = $_POST['user_password'];
    
    
    $query = "SELECT * FROM `user_tbl` WHERE user_name='$user_name' and AES_DECRYPT(user_password , '@ert') = '$user_password'";
    
    $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
    $count = mysqli_num_rows($result);
    

提交回复
热议问题