Thread: Multiple data
View Single Post
  #6 (permalink)  
Old 06-12-2004, 10:51 AM
koisempoi koisempoi is offline
Novice Webmaster
 
Join Date: Feb 2003
Location: JB
Posts: 26
Rep Power: 0
koisempoi is on a distinguished road
Send a message via Yahoo to koisempoi
yap betulll

betullahtu heterozigot.ni penyelesaian dia

test1.php
PHP Code:
<?php 
include 'dbase.php';

$query="SELECT * FROM test";
$result=mysql_db_query($dbname,$query);
$num=mysql_num_rows($result);
//$row=mysql_fetch_array($r);
//$username=$row['username'];

?>

<form action="test2.php" method="post" name="form" id="form">
<?php while($row=mysql_fetch_array($result)) { 
//$username=$row['username'];
$nama=$row['nama'];
$id_ahli=$row['id_ahli'];
?>
 <input name="pilih[]" type="checkbox" id="$pilih[];" value="<?php echo $id_ahli?>">
 <?php echo $nama?>
  <?php echo $id_ahli;?><br><?php ?>
  <input type="submit" name="Submit" value="Submit">
</form>
test2.php
PHP Code:
<?php
include 'dbase.php';

if (isset(
$_POST['Submit'])) {
$pilih=$_POST["pilih"];
for(
$i=0;$i<count($pilih);$i++) {
echo 
$pilih[$i].'<br>';
$query="DELETE FROM test WHERE id_ahli=".$pilih[$i];
$result=mysql_db_query($dbname,$query);
}
}

?>

dah banyak tempat aku tanya benda ni tapi xda yg dapat jawab.korang mmg tererlah.
Reply With Quote