i have a question how to use an alias from a select query:
$timecheck = $db->query("SELECT DOE <= NOW() AS trigger FROM table WHERE a='$a'");
if ($trigger != 0){
do something
}
is this the right way to use an alias? i need the alias trigger to check for a validation of a timestamp period. if that period is 0 or less means ‘trigger’ will output 1. in case of that another query should be performed.
so i hope my question is clear enough. i would really appreciate if there is someone who could help. thanks alot.
I think “trigger” may be a reserved word. Try: