Jump to content

multi dimension array : need help


vikaspa

Recommended Posts

:'(

i want to edit a product and allocate industries to a product

 

refer following link to view

 

http://meriwebsite.net/envytech/admin/industryallocate.php?pageNum=1SELECT%20a.products_id,%20a.products_image,%20b.language_id,%20b.products_description,%20b.products_name%20%20%20FROM%20products%20a%20,%20products_description%20b%20WHERE%20a.products_id%20=%20b.products_id%20and%20language_id=1%20and%201%20order%20by%20%20b.products_id,%20%20b.products_description

 

I can update prouct name and serial number

 

but cannot get values for industries

 

the do while loop for industry display  is given below (displaying industry id before check box here)

$iquery="SELECT * from industry  ";
		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 echo $irows['name'];?>	 
	<?php } while (	$irows = mysql_fetch_assoc($iResult)	);

	?>  

 

I am trying to display values using following code

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 ".print_r($_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 not getting correct values for $_POST['industry'][$i]

 

please help

 

 

Link to comment
https://forums.phpfreaks.com/topic/235151-multi-dimension-array-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.