MySQL Forums
Forum List  »  PHP

for loop or not?
Posted by: Dimitris Papageorgiou
Date: July 17, 2017 02:55AM

Although I do know how to insert many rows in a table(with a single query), in the situation I am facing things are not so straight forward.Let me explain:

I have an app where the business user enters his services offered in a form and these consequently must enter a database....there would not be a problem if every user offered the exact number of services...the issue is that this varies.(the services go from the client to the server in an array).

Suppose we have 4 or 3 or 2 services to enter in the it the best way to do it to use a for loop the runs a query that inserts one service at a time in the db?

Options: ReplyQuote

Written By
for loop or not?
July 17, 2017 02:55AM
July 17, 2017 10:22AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.