Generating MySQL query based on user's input using HTML Form

Hi,

I am trying to make a HTML web form which will be looking something like this:

Now, my question is, here I’ve shown three companies names have been entered. What if user wants to update rate for two companies instead of three?

How should I write query which can dynamically add variable/s inside its statement?

Thanks.

the relevant part of the query is…

 WHERE companyname IN ( [I]list of company names[/I] )

the rests of your solution depends on whichever application language you’re using – asp, php, whatever

please re-ask the question in the appropriate forum

“list of company names” - do I need to pass an array here?

Yes, using PHP.

list of company names would be a comma-seperated list of quote-encapsulated values. use of the [FPHP]implode/FPHP function would be advised.

Hi StarLion, thanks for your suggestion. I got it done :slight_smile: