Do math inside a SQL statement?
I'm trying to make it so I can select values that are below 601 (slightly
10 minutes). I take time() and subtract it by the field time. I don't
understand why it isn't working. Can someone explain or does SQL just not
have this ability. I don't get any error, though it gives data that
doesn't make much sense.
$pdo->query("SELECT * FROM `online` WHERE '".time()."'-`time` > 601");
It doesn't seem to be working.
No comments:
Post a Comment