Results 1 to 8 of 8

Thread: [RESOLVED] MySQL UPDATE TABLE problem.

Threaded View

  1. #1

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

    Resolved [RESOLVED] MySQL UPDATE TABLE problem.

    Hi.
    What im trying to do is.Update a table full of max size's.These size's determine the "MAX FILESIZE" that a person can upload to the server with.Depending on their access level.

    The problem im having right now (which probably has a simple solution) is updating the max size.

    I am really stumped.I've tried everything from two foreach's too a for loop.

    This is what the table, that i am using, looks like.


    My problem is of course the updating of the max filesize.Using this code.HTML included.

    PHP Code:
    //----------------------------------
    if(isset($_POST['update'])){
                
        if(is_array($_POST['maxsize'])){
            foreach($_POST['maxsize'] as $size){
        //??????????????????????????????????????? This is where i have the problem.
            }
        }
    }
    //==================================
    $SQL = "SELECT dms.*, acl.* FROM ".DOWNLOADSMAXSIZE_TABLE." dms JOIN ".ACCESS_LVL_TABLE." acl ON dms.accessID = acl.access_id";
    $RESULT = mysql_query($SQL) or print(mysql_error());
    ?>

    <form id="form1" name="form1" method="post" action="download_management.php">
      <table width="31%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
        <tr>
          <td colspan="2" bgcolor="#003366" class="content_header">Download - Max File Size </td>
        </tr>
        <tr>
          <td colspan="2" bgcolor="#003366" class="content_header2">*Note: -1 = Unlimated</td>
        </tr>
        <?
      while($row = mysql_fetch_array($RESULT)):
      ?>
        <tr>
          <td width="42%" bgcolor="#003366" class="content_row1"><div align="left">
              <?=$row['access_name']?>
          </div></td>
          <td width="58%" bgcolor="#003366" class="content_row2">
              <input type="hidden" name="sizeID[]" value="<?=$row['accessID']?>"/>
          <input type="text" name="maxsize[]" class="txtBox" value="<?=$row['size']?>" /></td>
        </tr>
        <?
      endwhile;
      ?>
        <tr>
          <td colspan="2" bgcolor="#003366" class="content_header"><div align="center">
              <input type="submit" name="update" class="txtbox" value="Update"/>
          </div></td>
        </tr>
      </table>
    </form>
    Im stumped on this.
    Last edited by PlaGuE; Jul 24th, 2006 at 04:26 PM.
    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