How to Handle Concurrency control in PHP & MySql

1k views Asked by At

I am using the core PHP & Mysql to building a project and I have a registration form that is divided into multiforms (say 4 to 5 forms) and each form is getting user details from new users, and i want to save the users data to database tables at the final submission of form, so my question is where to save the data got from mutiforms?

situation: 1. if i use the session variable to store the forms data, then it will take too much server resources to store data to session or worse if i got many users at the same time of registration. so sessions can slow down the server.

Please suggest a solution for that.

2

There are 2 answers

0
O.Palm On

you can get all fields in javascript and send to server with ajax. Other solution is request individual form and use SQL transactions.

6
sensorario On

Store all data in a database and just match data with user's session id.