Let's say you have a table with a timestamp column, and you want to parse this column into two arrays - $date and $time .
You personally:
a), for example, DATE(timestamp), TIME(timestamp) , or possibly even until HOUR(timestamp), MINUTE(timestamp
b) take the timestamp column and parse it as needed using a loop in PHP
It seems to me that (a) easier ... but I know that I know nothing. And it seems a little mischievous for my query to hit the same column 2 or 3 times for output ...
Is there any best practice for this?
source share