Jump to content

nominator

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nominator's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=378026:date=May 29 2006, 04:19 AM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ May 29 2006, 04:19 AM) [snapback]378026[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code] $result =mysql_query("Select * from staff"); if($myrow = mysql_fetch_array($result)); { do{ printf("             <tr>                 <td width=100><span class=text>%s</span></td>                 <td width=100><input type=checkbox name=check[] value=%s></td>              </tr>",$myrow[name],$myrow[staff_id]);              }while($myrow=mysql_fetch_array($result)); } [/code] and [code] if($action == 'delete')     {         $check = $_POST['check'];         connect();         if(count($check)) {              $check_id_list = "(".implode(",",$check).")";              mysql_query("Delete from staff where staff_id in ".$check_id_list);          }                } [/code] [/quote] not working.. Warning: implode(): Bad arguments. in /home/itecollege/domains/itecollege.com/public_html/stcc/manager.php on line 36 woops..working le..sorry
  2. hi, i am doing a member system. at the admin panel which have a list of user, has a checkbox each at the side. I did a loop to display all user from db and set the checkbox value to the id accordingly [code] $result =mysql_query("Select * from staff"); if($myrow = mysql_fetch_array($result)); { do{ printf("             <tr>                 <td width=100><span class=text>%s</span></td>                 <td width=100><input type=checkbox name=check value=%s></td>              </tr>",$myrow[name],$myrow[staff_id]);              }while($myrow=mysql_fetch_array($result)); }[/code] then for my action delete, [code]    if($action == 'delete')     {         $check = $_POST['check'];         connect();         mysql_query("Delete from staff where staff_id='$check'");     }[/code] i select a few user to delete, but it only delete one...how can i make it delete whatever i checked.
  3. Hi, i alot a db table called "staff". it has all the staff details, eg username, pass, email etc etc. Under my admin page, i wanna allow admins to delete staff. i wanan output all staff username and a checkbox at the side. If the checkbox is ticked, the staff is deleted from database. If example 5 staffs are ticked, all 5 staff will be remove from db How do i prin all records with a checkbox at the side and delete when ticked thanks in advance
×
×
  • 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.