V
V
Volodymyr2021-04-08 15:18:41
PHP
Volodymyr, 2021-04-08 15:18:41

How to write to the database one by one?

Hello!

How to write to the database one by one?
Well, for example, there is a script.php controller, which is accessed through the site a large number of times. How to make the order of writing to the database so that if a person now accesses the script, then a record with the number 1 goes to the database, the next person accesses the script, then a record with the number 0 goes to the database, etc., either 1 or 0.
How all this to define and write down? if several people can access the script at once.

Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-04-08
@volodyalesha86

The database has an autoincrement field type, more precisely, it is an attribute for an index field. Any insertion increments it by 1 . use it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question