Try this...[php]
<?
include("test.p hp");
mysql_select_db ("a2840013_Data base",$cipai) or die ("Cannot Connect At Delete Form");
$not_deleted = array(); //TO SAVE DELETED IDS
foreach($_POST[checkbox] as $key=>$selected _id)
{
if (!mysql_query(" DELETE FROM `customer` WHERE `id_Customer` = '".$selected_id ."'"))
array_push($not _deleted, $selected_id);
}
echo "Successful ly deleted:<br/>".implode(", ", array_diff($_PO ST[checkbox], $not_deleted));
if (count($not_del eted)>0)
echo "<br/>Unable to delete:<br/>".implode(", ", $not_deleted);
?>
[/php]
i have write it like this...
[php]
<?
include("test.p hp");
mysql_select_db ("a2840013_Data base",$cipai) or die ("Cannot Connect At Delete Form");
$not_deleted = array();
foreach($_POST[checkbox] as $key=>$selected _id)
{
if (!mysql_query(" DELETE FROM customer WHERE id_Customer = '".$selected_id ."'"))
array_push($not _deleted, $selected_id);
}
echo "Successful ly deleted:<br/>".implode(", ", array_diff($_PO ST[checkbox], $not_deleted));
if (count($not_del eted)>0)
echo "<br/>Unable to delete:<br/>".implode(", ", $not_deleted);
?>
[/php]
but the result is... Successfully deleted: and with "," in the new line...
if i try delete 3 record then ",," just like that...or maybe in my delete.php something wrong? this is the code
[php]
<?
echo "<form method='POST' action='del_cus t.php'>";
while($row=mysq l_fetch_assoc($ result)){
echo "<table width ='100%'+ border='1'>";
echo "
<tr>
<td><input type='checkbox' name='checkbox[]' value=''.$row[id_Customer].''></input></td>
<td width = '10%'> $row[id_Customer] </td>
<td width = '30%'> $row[Nama_Customer] </td>
<td width = '20%'> $row[Alamat] </td>
<td width = '10%'> $row[Kota] </td>
<td width = '20%'> $row[C_Person] </td>
<td width = '5%'align='cent er'> $row[Nom] </td>
</tr>
</table>";
}
echo "<input type='submit' value='Submit' name='submit'>" ;
echo "</br><input type='text' name='nomdat'>" ;
echo"</form>";
$Te =mysql_num_rows ($result);
echo "<b><font color='blue'><h 3> Jumlah Record Customer Tersimpan= $Te </h3></b></font>";
?>
[/php]
thank you for all your help...