MYSQL / PHP AES_Decrypt函数传递值

时间:2016-01-09 13:28:21

标签: php mysql encryption

 if ($db_found) {
        $result = mysql_query("SELECT *, 
           CAST(AES_DECRYPT(jmeno, 'usa2010') AS CHAR(50)) name,
           CAST(AES_DECRYPT(prijmeni, 'usa2010') AS CHAR(50)) lastname,
           FROM   pacienti WHERE id='13'");

    while ($row = mysql_fetch_array($result)) {
        $together = $row['name'] . " " . $row['lastname'];

        }
      echo  $together;
    }

Variable $ together为null,但应包含表中的数据。 sql请求之后的表输出的屏幕截图enter image description here

1 个答案:

答案 0 :(得分:0)

尝试在循环中编写echo

while ($row = mysql_fetch_array($result)) 
{
   echo $together = $row['name'] . " " . $row['lastname'];
}