Jump to content
Sign in to follow this  
cyberfly

Delete Multiple Data Using Checkbox (php)

Recommended Posts

table mark

------------

idTable | assg1 | assg2 | assg3 | test1 | test2

----------------------------------------------------

1 40 30 40 70 70

Fungsi : Lecturer boleh pilih nak delete markah assigment atau kuiz yang dikehendaki.So aku guna checkbox.

Problem : Camne cara nak delete dalam column guna checkbox?dah puas mengoogle tapi tak jumpa :(

Share this post


Link to post
Share on other sites
delete multiple column?? hmm..

ape kate ko buat box utk delete utk setiap markah tu..
on click, value jadik kosong.. kalo tak click.. die ade value.. and value tu buleh diubah..
after dah edit n check box utk delete..
press submit button.. buat sql utk update dlm table.. kalo ade value boleh edit.. kalo delete.. value akan diupdate jadik kosong..

fahamkan logik ini

Share this post


Link to post
Share on other sites
<form name=deleteform method=post action=delete.php>

<?php

$query = mysql_query = ("select * from mark") or die (mysql_error());

while($row = myqsl_fetch_array($query))
{
print "<input type=checkbox name=assignment1>$row['assg1']";
print "<input type=checkbox name=assignment2>$row['assg2']";
print "<input type=checkbox name=assignment3>$row['assg3'];
print "<input type=checkbox name=test1>$row['test1']";
print "<input type=checkbox name=test2>$row['test2']";
}

?>
<input type=Submit value=Delete name=Submit>

coding ni tak full ... ko kena tambah skit ...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...