PHP and MySQL: base64_decode within SELECT

0

Hello,

I have an INSERT that registers with the database with base64_encode (), working perfectly.

"INSERT INTO Atendimento_Campo_Prontuario (
                        acpr_id,
                        acpr_apro_id,
                        acpr_valor
                        )
                    VALUES (
                        :acprn_id,
                        :acprapro_id,
                        :acpr_valor)";
$p_sql->bindValue(':acpr_valor', base64_encode($acpr->getAcpr_valor()));

Now I need base64_decode to fetch this information, can anyone help me with this?

Is there any way to pass the base64_decode () within SELECT as I do with acpr_id?

"SELECT * FROM  table WHERE table.acpr_id =:acpr_id";

$p_sql = Conexao::getInstance()->prepare($sql);
$p_sql->bindValue(':acpr_id', $acpr->getAcpr_id());
    
asked by anonymous 20.07.2016 / 20:10

1 answer

0

In case, before fetching the information in the database encrypt the variable, just like in the insert.

Stop displaying the variable on the screen after you search for the result, decrypt it using

echo base64_decode ($ value);

    
20.07.2016 / 21:03