I'm reformulating a client system and it is using procedural mode in login and not PDO, but to give more security, I used sprintf
, but it is not working. See:
$sql = sprintf(
"SELECT *, DATE_FORMAT(DataAcesso,'%d/%m/%Y') AS DataDeAcesso,
DATE_FORMAT(DataAcesso,'%H:%i') AS HoraDeAcesso
FROM loja_admin WHERE EmailAdmin = '%s' AND SenhaAdmin = '%s'",
mysqli_real_escape_string($this->conexao, $loginUsuario),
mysqli_real_escape_string($this->conexao, $codificado)
);
$query = mysqli_query($this->conexao, $sql);
And when I give echo
to variable $sql
, nothing appears. But when I shoot DATE_FORMAT()
, it works. Would you have any way to resolve this?