Each user on the site has its own unique code. So, there is a certain function on the site and I need to keep records of how many times the user has used it. For example, it comes in for the first time, then a new value is entered in the table with the user code and 0 in the visits column, and each subsequent time you need to add 1 to the visit column. You also need this figure (visits) to return to the site and the user has seen how many times he used the function.
- Well, create a table to store this data (you can also have a field in the user table, but worse), with each call to the function, make changes to the data (INSERT .. ON DUPLICATE KEY UPDATE) and immediately request them for output. - Akina
- @Akina, I'm just not very familiar with the technologies of MySQL and its communication with PHP. Can you recommend articles for reading? - StartProg
- In any book with the basics of PHP there is a section on working with mysql. Articles googled by request. - Oboroten
|