Re: Dynamic Form List - how to change values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks to all who helped.

The answer...drumroll.... arrays for each entry:

load routine (partial):
print "<td align='center' valign='top'><input type='text' name='imageqty[]' size='5' value='$qty'></td>"; print "<input type='hidden' name='hiddenalbum[]' value='".$row[cialbum]."'>";
	print "<input type='hidden' name='hiddenset[]' value='".$row[ciset]."'>";
print "<input type='hidden' name='hiddenimage[]' value='".$row[ciimage]."'>"; print "<input type='hidden' name='hiddensize[]' value='".$row[cisize]."'>";

retrieval routine (partial):
		$cartid = $_COOKIE['PHPSESSID'];
		$imageqty = $_POST['imageqty'];

		$qty = $_POST["imageqty"];
		$album = $_POST["hiddenalbum"];
		$set = $_POST["hiddenset"];
		$image = $_POST["hiddenimage"];
		$size = $_POST["hiddensize"];
		
		$n = count($qty);
		$index = 0;
		
		while($index < $n)
		{
			$newqty = $qty[$index];
$queryupdate = "update CartItems set ciqty = '$newqty' where ciid = '$cartid' and cialbum = '$album[$index]' and ciset = '$set[$index]' and ciimage = '$image[$index]' and cisize = '$size[$index]'";
			querythedatabase($queryupdate);    // my routine
			
			$index++;
		}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux