hello... i need help from you all.. i am still new in php.. i hope you all can help me.. i am desperate. i can't delete delete data(delete multiple row from mysql using check box).
this is my coding.. the cooperation is greatly appreciated. i have 2 file
this is my coding

1 file = test1.php
<?php session_start(); ?>

include("db_connect.php"); //connection
mysql_select_db($database_localhost, $conn)or trigger_error(mysql_error(),E_USER_ERROR);

$result=mysql_query("SELECT * FROM cek1a");
<script language=javascript>
function validate()
var r=confirm("Adakah anda pasti ingin padam?")

  if (r==true)
    return true;
    return false;


<table bordercolor="#CCCCCC" border='1' cellspacing='1' cellpadding='1'>

<form name="test1" method="post" action="test2.php" onSubmit="return validate()">
<th bgcolor="#6495ED">NoCek</TH>
<th bgcolor="#6495ED">NAMA </TH>
<th bgcolor="#6495ED">JUMLAH</TH>
<th bgcolor="#6495ED">TUJUAN</TH>
<td align="center"><?php echo $row['noC'];?></td>
<td align="center"><?php echo $row['name'];?></td>
<td align="center"><?php echo $row['jumlah'];?></td>
<td align="center"><?php echo $row['tujuan'];?></td>
<td align="center"><input type="checkbox" name="delete[]" value="<?php echo $row['noC'];?>"></td>
<td colspan="4">
<CENTER><input type="submit" value="HAPUS"></CENTER>



second file = test2.php


if (isset($_POST['delete']) && is_array($_POST['delete']))
foreach ($_POST['delete'] as $num => $value)
$sql="delete  from cekla where noC='$value'";

i hope you all can help me. :)

1) Check spelling of table name. once you have "cek1a" and second is "cekla".
2) if spell is proper and still its not working then add below code on top of test2.php and post output.

echo '<pre>';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.