PHP and MySQL syntax: Difference between revisions

Jump to navigation Jump to search
m
→‎now: add SELECT CURRENT_TIMESTAMP;
m (→‎now: add SELECT CURRENT_TIMESTAMP;)
Line 4: Line 4:
the human readable time format ex: 2010-12-21 10:05:06
the human readable time format ex: 2010-12-21 10:05:06
* php: echo date("y-m-d H:i:s", time() ); //Convert the time stamp of current time to the human readable time format. Ex: return '2010-12-21 10:05:06'
* php: echo date("y-m-d H:i:s", time() ); //Convert the time stamp of current time to the human readable time format. Ex: return '2010-12-21 10:05:06'
* mysql: SELECT NOW(); /*the human readable current time */
* mysql:  
** SELECT NOW(); /*the human readable current time */
** SELECT CURRENT_TIMESTAMP;


the current timestamp ex: 1292897201
the current timestamp ex: 1292897201

Navigation menu