Code:
<?
include ("db1.php");
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$query1="select * from manufacturers";
$sqlres1 = mysql_query($query1);
$count=mysql_num_rows($sqlres1);
$i=0;
while($rows=mysql_fetch_array($sqlres1))
{
?>
<tr><td align="center"><input name="checkbox1<? echo $i;?>" type="checkbox" value="<? echo $rows['manufacturers_id']; ?>"></td>
<td><input type="text" name="manufacturer<? echo $i;?>" value="<? echo $rows['manufacturers_name']; ?>" /></td>
<td><input type="checkbox<? echo $i;?>" name="AVAIL" value="" checked="checked" /></td> <td><a tabindex="-1" class="style1" href="javascript:var popup2=window.open('getinfo.php?action=manufacturer&id=<? echo $rows[
'manufacturers_id']; ?>','Manufacturer','width=400, height=400,location=no,menubar=no,status=no, toolbar=no,
scrollbars=yes,resizable=yes');">Details</a></td>
<!--<td>< ? echo $fetch1['item_price'];?></td>--></tr>
<?
$i++;
}
if(isset($_POST['edit']) && ($_POST['edit']=='Edit'))
{
for($i=0;$i<$count;$i++)
{
if(isset($_POST['checkbox1'.$i]))
{
$y=$_POST['manufacturer'.$i];
$ssql = "update manufacturers set manufacturers_name='".$y."' where manufacturers_id=".$_POST['checkbox1'.$i];
$rresult = mysql_query($ssql);
}
}
// if successful redirect to delete_multiple.php
if($rresult){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=manufacturer.php\">";
}
}
mysql_close();
#--------------------- End of Updation ---------------
?>
Bookmarks