1
I made the QUERY
a CASE to display in 'Data' output if current, expired or pending, but for pending has no output when printa.
$sql_check_plano = "SELECT
*,
(
SELECT
`ps_nome`
FROM
`plano_pack`
WHERE
`ps_token` = `pu_ps_token`
LIMIT
1
) AS `plano_nome`,
(
SELECT
CASE
WHEN
TIMEDIFF(`pu_data_expira`,NOW()) < 0 THEN 'Expirado'
WHEN
TIMEDIFF(`pu_data_expira`,NOW()) > 0 THEN 'Vigente'
WHEN
`pu_data_expira` = '0000-00-00 00:00:00' THEN 'Pendente'
END
) AS `Data`
FROM
`plano_usuario`
WHERE
`pu_user_token` = '" . $_SESSION['usuario']['user_token'] . "'
ORDER BY
`pu_data_cad`
DESC
;";
Have you checked if NO_ZERO_DATE mode is enabled in your settings? If you are testing with IS NULL.
– anonimo
in the migration coming to the production environment do not know how will be the settings, so I am avoiding using resources that depend on custom configuration, but worked as you suggested, this no_zero_date was unaware.
– ElvisP