Results 1 to 1 of 1

Thread: [RESOLVED KINDA] the dreadful SpaCe

  1. #1

    Thread Starter
    Hyperactive Member PlaGuE's Avatar
    Join Date
    Jun 2005
    Location
    in ur mind.
    Posts
    445

    Resolved [RESOLVED KINDA] the dreadful SpaCe

    okay i have this code... and it works fine. or so i thought...
    PHP Code:
     case "remove_trainer"
      if (
    is_array($_POST['rem_trainer'])) {
        foreach(
    $_POST['rem_trainer'] as $trainer) {
            
    $trainer addslashes($trainer); // use if magic quotes is disabled

            
    mysql_query("UPDATE members SET trainer = 0 WHERE username = '$trainer'") or die(mysql_error());

            echo 
    "Removed trainer $trainer from list.<BR>";
        }

     echo
    "<form action=index.php?console&OPT=remove_trainer method=post>
    <table width=100%  border=0 cellspacing=0 cellpadding=0>
      <tr>
        <td scope=col>Remove Trainer(s): </td>
      </tr>
     "
    ;
      
    $sql "SELECT * FROM members WHERE trainer = 1";
      
    $result mysql_query($sql) or die(mysql_error());
      while(
    $row mysql_fetch_array($result)) {
      echo
    " <tr>
        <td scope=col><input name=rem_trainer[] type=checkbox value=
    $row[username]>$row[username]</td>
      </tr>"
    ;
      }
     echo
    "
      <tr>
        <td scope=col><input type=submit name=removed value='Remove Trainer'></td>
      </tr>
    </table>
     </form>"

     break; 

    the ONLY PROBLEM IS... it wont UPDATE anything with spaces in it...I tried replacing the (space) with the &nbsp; and it didnt help...
    Last edited by PlaGuE; Aug 30th, 2005 at 02:32 AM.
    Without balance, there could only be chaos.
    Without chaos, there could be no balance.
    I live with karma. Eat with destiny. Dream of life without shackles....
    Yet. If life had no consequences, life could not exist, nor could it flourish.


    If at first you dont succeed.You're screwed.

    C++/Java NOOB.

    I aint a professional at PHP, but if i can help i will.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width