Jump to content

passing the booking time to the db


jimfog

Recommended Posts

I am building a web app where the user will select booking slots/hours. The question is what column type the db table will have that is going to accept those entries. My understanding is that since we ARE NOT RECORDING an instance of time, that it should be just VARCHAR. I mean the user, in essence, will select strings(because the time slots depicted) will be just strings, as such, I think that as strings these must be passed to the db. What do you think?

  • Like 1
Link to comment
Share on other sites

VarChar would be inefficient. Best will be to store it as ineteger timestamp. inetegers are always good to work on. more over it storing timsetamp will let you swicth between timezone just changing the timezone in php. though there is dedicated data type to store date and time (see the reference in their site about DATE and DATETIME data type).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...