I want to run mysql queries to insert data from a custom html form.
Here I have to insert multiple set of data, some data to one table and some to other. Currently I am using the simple approach to send data to php page using jquery ajax and run multiple mysqli_query() functions one after another. But I guess when there will be large number of users, there will be problems related to speed. So can anyone suggest me a better way to do the same.
There are 5 tables in the database and each table has 7 to 10 columns that need to get different set of data, every time.
I want to run each query only if the previous insert query is successfully completed. That's why I am checking for the result every time and then running the next query, which makes me feel the issue of speed on large user base.
INSERT INTO myTable(id, anything, ...) VALUES (id, any, ...), (id2, any2, ...),(id3, any3, ...),...mysqli_begin_transactionfollowed bymysqli_commitwhen done or look here stackoverflow.com/questions/5178697/…