2
Just create a table with the date field of type TIMESTAMP
and with the pre-defined value as CURRENT_TIMESTAMP
Follow Example sql:
CREATE TABLE `tabelateste` (
`data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
)
This way, whenever you enter a record, you do not need to inform the date, and it will be inserted with the server system date
You could do me a favor, you have that data from the above forms, type, number of the command, on one of the table , request for food and drink and quantities, could you show me how to create the table together with the date and time ? would be grateful @localhost
– allan araujo
yes , with the shaman
– allan araujo
well the name of the database is fishmongery , the data to be entered are those of the image above , type , number of the command , will come automatically every time I open a new form. has the table number, meal and quantity, drink and quantity.
– allan araujo
I recommend Create an ordered table with {id_request,numero_command, numero_table} and another item_request{id_item table, id_order, order, quantity} . This would be the simplest way, where the requested id_and always informed on each item that will be informed in the item_request table
– LocalHost
then it will be these two new and the date and time table is
– allan araujo
@allanaraujo the table that has the date would be on request , it would be a request with the information of the same, ai na outra armazria os itens desse pedido
– LocalHost
It was like this CREATE TABLE
peixaria
.item_pedido
(id_item
INT NOT NULL ,id_pedido
VARCHAR(255) NOT NULL ,pedido
VARCHAR(255) NOT NULL ,quantidad
VARCHAR(255) NOT NULL ,data
TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,algo
VARCHAR(255) NOT NULL , PRIMARY KEY (id_item
)) ENGINE = Myisam CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; is correct ?– allan araujo
@allanaraujo believe so, but the amount could be int or double
– LocalHost