Jump to content

then90

New Members
  • Posts

    1
  • Joined

  • Last visited

then90's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have doubt on how to include two fields(Productcode,Effectivedate) that is to be considered on deletion. Following is the code, Following is the code for delete function, if(isset($_POST['Delete'])) { $checkbox = $_POST['checkbox']; //from name="checkbox[]" $countCheck = count($_POST['checkbox']); for($i=0;$i<$countCheck;$i++) { $prodidd = $checkbox[$i]; $prod1 = $checkbox[$i]; ///$prodid= $_POST['checkbox']; $sql = "DELETE FROM `oemanucfacturemapping` WHERE Productcode ='".$prodidd."' and Effectivedate = '".$prod1."'"; $result = mysql_query($sql); } if($result){ ?> <script type="text/javascript"> alert("Deleted Successfully!!");document.location='oemanufacturermap.php'; </script> <? } } The checkbox value is taken from the following code, <table align="center" class="sortable" bgcolor="#FF0000" border="1" width="900px"> <td>#</td><strong><td>OEManufacturer Name</td></strong><td>Product Code</td><td>Manufacturer Warranty</td><td>Sales Warranty</td><td>Effective Date</td><td>KMRun</td><td>####</td> <?php // This while will loop through all of the records as long as there is another record left. while( $record = mysql_fetch_array($query)) { // Basically as long as $record isn't false, we'll keep looping. // You'll see below here the short hand for echoing php strings. // <?=$record[key] - will display the value for that array. ?> <tr> <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<?php echo $record['Productcode'],$record['Effectivedate'];?>"></td> <td bgcolor="#FFFFFF"> <?=$record['OEManufacturename']?> </td> <td bgcolor="#FFFFFF" align="left" valign="top"> <?=$record['Productcode']?> </td> <td bgcolor="#FFFFFF" align="left" valign="top"> <?=$record['ManufacturingWarranty']?> </td> <td bgcolor="#FFFFFF" align="left" valign="top"> <?=$record['Saleswarranty']?> </td> <td bgcolor="#FFFFFF" align="left" valign="top"> <?=$record['Effectivedate']?> </td> <td bgcolor="#FFFFFF" align="left" valign="top"> <?=$record['KMRun']?> </td> <td bgcolor="#FFFFFF" align="left" valign="top"> <a name="edit" href="oemanufacturermap.php?Productcode=<?=$record['Productcode']?>&Effectivedate=<?=$record['Effectivedate'];?>">Edit</a></td> <?php } ?> </table> Help pls, How can i do this?
×
×
  • 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.