Jump to content

coldasice

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

coldasice's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. dunno if i shuld post this in here but now im stuck another place i dont quite get... why is that the loops stop when i try to add my date function to the textbox : ( [attachment deleted by admin]
  2. forgot to add a check to see if its set plz merge mod when ever u read.. cuz i couldnt edit
  3. Uploaded with ImageShack.us wow this shit is working thanks!!!! thats what i call a mind block.. strange it gives error Warning: Invalid argument supplied for foreach() in C:\Program Files (x86)\VertrigoServ\xxxx\xxx\xxx\xxx\xxxx.php on line 51 foreach ($check as $userID) { $adminlvlupd = $adminlvl[$userID]; $banupd = $ban[$userID]; $bantimeupd = $bantime[$userID]; $this->_sql = "UPDATE user SET adminlevel='".$adminlvlupd."',ban='".$banupd. "',ban_time='".$bantimeupd."' WHERE id='".$userID."'"; mysql_query($this->_sql) or die(mysql_error()); echo "user upd"; }
  4. well thanks that helps this is my form kode and i dont have any prosess code yet since i dont know how to do it with this type of form input $this->_sql = "SELECT * FROM user"; $this->_query = mysql_query($this->_sql); echo '<div id=users> Update ur Admin status<br /> Username | Admin level | Ban | tids ban format: yyyy-mm-dd h:m:s <br />'; echo '<form method="Post">'; while ($user = mysql_fetch_object($this->_query)) { echo ''.$user->username.': '; echo '<input type="checkbox" name=check[] value='.$user->id.' />'; echo '<select name=adminlvl[]>'; // enum from mysql $this->_sql = "SHOW COLUMNS FROM user LIKE 'adminlevel'"; if ($result = mysql_query($this->_sql)) { $enum = mysql_fetch_object($result); preg_match_all("/'([\w ]*)'/",$enum->Type,$values); $this->_values = $values[1]; } // end foreach ($this->_values as $k => $v) { if ($v == 1) { if ($user->adminlevel == 1) { echo '<option selected value="'.$v.'">User'; } else { echo '<option value="'.$v.'">User'; } } if ($v == 2) { if ($user->adminlevel == 2) { echo '<option selected value="'.$v.'" >Nyhets Admin'; } else { echo '<option value="'.$v.'">Nyhets Admin'; } } if ($v == 3) { if ($user->adminlevel == 3) { echo '<option selected value="'.$v.'">Moderator'; } else { echo '<option value="'.$v.'">Moderator'; } } if ($v == 4) { if ($user->adminlevel == 4) { echo '<option selected value="'.$v.'" selected>Administrator'; } else { echo '<option value="'.$v.'">Administrator'; } } } echo '</select>'; $this->_sql = "SHOW COLUMNS FROM user LIKE 'ban'"; echo '<select name=ban[]>'; if ($result = mysql_query($this->_sql)) { $enum = mysql_fetch_object($result); preg_match_all("/'([\w ]*)'/",$enum->Type,$values); $this->_values = $values[1]; } foreach ($this->_values as $k => $v) { if ($v == 0) { if ($user->ban == 0) { echo '<option selected value="'.$v.'">UnBan'; } else echo '<option value="'.$v.'">UnBan'; } if ($v == 1) { if ($user->ban == 1) { echo '<option selected value="'.$v.'">Ban'; } else echo '<option value="'.$v.'">Ban'; } } echo '</select>'; echo '<input type="text" value="'.date("Y-m-d H:i:s").'" name=bantime[] />'; echo "<br />"; } echo '<input type="submit" name="submit" value="Save" class="submitbox">'; echo '</form>'; echo "<br />"; echo "</div>";
  5. oh my bad this was the old info i upg it right way what i mean is when i check i only what whats where i check to go to the $_POST! but now everything goes..
  6. i want to insert only whats checked to db:) but everything get posted for now i came upwith a for loop but thats for inserting all data not only whats checked any one know a good way to do this?
×
×
  • 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.