Hello, i use a client server application; so many times i would have to call several update statements in a single save button click. now i call execute for each update query from my client app. my question: is it possible to put the queries into a single string and pass it to mysql and execute it at once . i think it is a very common scenarion . Thanks. Any help would be appreciated
That depends on your data. If the user isn't changing anything (he just clicks the button once) you should be able to write a single update statement with a WHERE clause. If you're updating multiple tables, do that on the server if all the data from the client is the same for every one you're now generating. If you REALLY need to cut down on database server bandwidth usage, try a stored procedure.
You should be able to do this with prepared statements etc and batch it. You'd need to make sure any SQL injection issues are dealt with though.