Let me explain what I am trying to do first. There are 2 tables each with items numbered mt1-mt300 and the user name. One table contains the prices, the other tells how many of that item they have. To display each item and it's price, I do a do...while loop with a counter that increments after each query, so that mt$ni is displayed(mt1(, then $ni=$ni+1, so that mt2 is displayed and so on so on. If they have >0 of the item then it queries the price from the other table and displays it as the value of an input form. That way they can change the price and do an update with the submit. All thsi works fine. It displays everything ok and if you retype in a new price and submit, the value carries over to the action page with no problems. The only problem is on the input field, the name="price$ni". That way if there are multiple items on the page (numbers 5 and 12 displayed) The names carried over to the action page will be different...$price5 and $price12 (depending on the item being looked at). Now on the action page, I want to update teh prices table with the new prices. I use a do...while loop for this to cycle through the entire table. So if I set my loop counter ($cnt, for this ex) to 1 then increment after each query, I can't use a variable inside a variable. The price coming into the page would $price5..however I can't use it in the query as $price$cntr. It always sets the price to value of $cntr at the time. How do I increment the price so that it will check each value and iupdate the price. It will work if I db_query("update table set price=$price5 where item=mt$cntr") on every instance . But I have 300 items and will being adding many more in the future, so I must have a loop. Sorry for the long message, but I had to explain for it make sense, and I have been trying to get this to work for 3 days now.
Thanks for all teh help