0
What is the best way to create a date_created and date_modified in MySQL Database?
i am using xamp for my database. now my problems is, i want to make a column date_created and date_modified in my products. i used a relational database to do that but it so hard to query. date_info (table) date_id | date_today (columns) products (table) date_created | date_modified (columns) example there is record in date_info = (1 , 01-28-2017) (2 , 01-27-2017) then in products = (1 , 2 ) How can i query the actual date in the products instead of id. or there is another way to do that?
4 Antworten
+ 4
You can use JavaScript new Date() and just make a few new columns in your table. Then, INSERT INTO that column with your manipulated value of Date() for date_created. As for date_modified, UPDATE the table and SET date_modified with a new value everytime.
+ 3
I don't know any other way. I'm sorry for being useless.
0
But what if i have a thousands of products. all of them has a date_created and date_modified, i think my application is take too long to load and my database is redundant because everyday i insert a record i also insert the current date for every products.
i am concern in memory, the time to load the program and the data integrity of my database.
By the way, thanks for your answer. I will do your suggestion for now.
0
No. It's okay i will do your suggestion, it is also a good idea. thank you again