I have stored procedure that takes an id and a string and stores the pair in a cross reference table. If my PHP receives 6 sets if id and string pairs, the PHP for-loop will execute this stored procedure six times.
If I have millions of users running this stored procedure, Is this an unnecessarily large load on my servers?
Should I instead concatenate the six strings into one delimited string and pass that larger string as one value to the stored procedure which will then split the string and enter each separate row into my table?
Sounds like you might want something like this:
This requires only a single query to be run, regardless of how many key/value pairs you have.