Sorry I wasnt very clear. I did mean that it was inserting the last stock value, which makes sense I suppose because thats what I was telling it to do wasnt it? Changing it to
mysql_query("UPDATE products SET numstock = '".$stockarray[$key]."' WHERE id = '".$id."'")
has fixed the problem, thanks.
I tried changing the if stock == "" part to both of the values you suggested, n both decided that I had empty fields, even when I didnt, possibly because they pick up zeros? That wasnt my intention, I just want to make sure no fields have been left blank. But as I understand it if (!empty($stock)) would mean "if stock isnt empty" would it not? I tried (empty($stock)) also but again it seems to think Ive blank fields where I dont. Anyway that part does seem to work as I had it originally, so I guess I'll leave it alone.
One last question, is there an easy way to refresh the data in the text fields after the query, so that the user can see the new updated values? A meta refresh doesnt work, and of course if you hit update or refresh manually again it will reinsert the original values because theyre the ones showing.