A
A
Andrey Boychenko2016-06-25 18:37:23
MySQL
Andrey Boychenko, 2016-06-25 18:37:23

Storing this kind of information MySQL?

Good afternoon. Please give some advice on how best to implement the database structure
for storing information. The site has an order calendar, by analogy with this link .
I didn’t think much and made the following kind of table and throw absolutely all the information there, which is absolutely not right.
================================================= ====================
id, place, name, phone, email, note, discount, price, time, state, day, month, year
===== ================================================= ===============
But now I understand that this is not quite what you need. If the client, for example, selects 16.00|17.00|.18.00 in a row, then the following entry will be placed in the time column - 16.00 - 18.00.
That is, when loading a page from the database:
1. Information about the time for which nothing can be ordered is immediately obtained.
2. When choosing free time, one hour - one record in the database, and if a person, for example, chooses 16.00|17.00|.18.00 in a row, then 3 records will be created in the table.
I'm thinking of making more tables.
1. Reserve table - the time for which an order cannot be placed will be stored here
===================================
id, place, day, month, year
==================================
2. Clients table - here will be stored information about the client who ordered a certain time
===================================
id, place, name, phone, email, note
===================================
3. Table Orders - here is the actual time. Here I think to store the time that the client has chosen. Every hour as a separate entry in the database.
Please tell me what kind of database structure you would make to store this kind of information. And actually in what form it can be stored in the example above.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
#
#algooptimize #bottize, 2016-06-25
@user004

time, state, day, month, year = timestamp ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question