Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4238114
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:51:44+00:00 2026-05-21T02:51:44+00:00

Is it better to store dates in mysql in three columns or use just

  • 0

Is it better to store dates in mysql in three columns or use just one column. Which one is faster. Also, if I just want to do inserts with todays date in format dd/mm/yy , how do I do that. and also how do I do selects with that. Also, lets say if I wanted to get results for all the wednesdays, how do I do that or lets say one date 25th of all the months and years, how do i do that.

Thanks People.

I am using PHP with Apache and Mysql.

What are the drawbacks of using the structure that I am proposing. I can easily get all the 25th by using the date table and I can get all the days using another column for days. How much difference would be there in the terms of speed between my proposed solution and using a DATE table?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:51:45+00:00Added an answer on May 21, 2026 at 2:51 am

    Also, if I just want to do inserts with todays date in format dd/mm/yy ,how do I do that.

    Well it depends on the format your date is passed in through your 
    form but you are going to want to store your date in YYYY-mm-dd format.
    
    INSERT INTO my_table (timefieldname) VALUES ( '$date' );
    

    and also how do I do selects with that.

    SELECT timefieldname FROM my_table;
    
    //or you can format the date - this will give you month/day/year 01/01/2012
    SELECT DATE_FORMAT(timefieldname, '%m/%d/%Y') FROM my_table;
    

    Also, lets say if I wanted to get results for all the wednesdays,

    SELECT timefieldname FROM my_table WHERE DAYNAME(timefieldname) = 'Wednesday';
    

    How do I do that or lets say one date 25th of all the months and years, how do i do that.

    SELECT timefieldname FROM my_table WHERE DAY(timefieldname) = '25'; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Generally, I had thought it was always better to store images in the filesystem
If I had a million images, would it be better to store them in
Suppose that you have to set 12 cookies, would it be better to store
Is it better to use a stored procedure or doing it the old way
Or better said: When to use array as a field data type in a
I need to findout a better and quick way to query MySQL table to
I have a somewhat complex query with multiple (nested) sub-queries, which I want to
Let's say I would like to store votes to polls in mysql database. As
I will be storing a year in a MySQL table: Is it better to
I have just realised if I add a particular record to my MySQL database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.