I am updating products
for each products i want to make provision to update industries applicable
these industries are displayed using following sql
$iquery="SELECT * from industry ";
echo "<br>ind query".$iquery;
mysql_select_db($database_DBconnect, $DBconnect);
$iResult = mysql_query($iquery, $DBconnect) or die(mysql_error());
$irows = mysql_fetch_assoc($iResult);
$itotalrows=mysql_num_rows($iResult);
$j=-1;
do { $j++; ?>
<br /><?php echo "id=". $irows['id'];?><input name="ind[$i][$j]" type="checkbox" class="vardana12" id="ind[$i][$j]" value="<?php echo $irows['id'];?>" />
<?php } while ( $irows = mysql_fetch_assoc($iResult) );
id for check box is ok
the value of $i is running serial number , domension for product
$j is dimension for industry for each product
when submit is clicked
I am checking values as follow
if ( (isset($POST['sub'] )) or (isset($srno['sub'] ))) {
echo "<br> count=".count($POST['srno']);
for($i=0; $i< count($POST['srno']); $i++){
echo "on 'save' clicked <br>";
echo "<br> products ".$POST['products_id'][$i];
echo "<br>srno ". $POST['srno'][$i];
echo "<br>industry ".count($POST['ind'][$i]);
echo "<br>product name ". $POST['products_name'][$i];
Updateindustry($POST['products_id'][$i], $POST['srno'][$i],$POST['industry'][$i],$_POST['products_name'][$i]); }
$update=1; $alert= "udation done";
}
i am getting correct valued for all required variables except
industry
above code displays
products 80
srno
industry 0
product name F-615update products set srno = 0, industry = 0 , products_name = 'F-615' where products_id = 80
on 'save' clicked
please help