How do I make mySQL timestamp field format using phpMyAdmin?
Can someone tell me how/where I go to make my timestamp field appear a certain way every time I create a new record.
SELECT DATE_FORMAT(new_ts, '%d/%m/%Y') FROM cartons_current
This works, but how do I make the field开发者_StackOverflow中文版 automatically do this with every new record?
SELECT DATE_FORMAT
doesn't change the format of the stored data at all, it just adjusts how MySQL gives you that data. You need to do DATE_FORMAT
in any SELECT
query against that table, or you can create a VIEW
(essentially, a fake table using a SELECT
query).
精彩评论