i've a simple table in MySQL with 2 timestamp fields:
*"...
creation timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_edit timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
..."*
When i try to fetch with a simple query:
SELECT * FROM customers
from my Node.js (mysqljs), json return:
creation: {}, // empty object
last_edit: {} // empty object
how can i get the date???
Thank in advance! :)
You need to insert at least one record into your table for any results to come back from a query against it.
If you for some reason just want to retrieve the current date from the database, you can do:
or