Jump to content

The-Last-Escape

Members
  • Posts

    116
  • Joined

  • Last visited

    Never

Everything posted by The-Last-Escape

  1. I've got a list of about 350+ numbers, and there' in the 700-800's, but I'd like to know how to do a ffew things: Order them form least to greatest AND // OR Count how many times each number appears, and display the results. How would I go about doing this?
  2. Simply type this in your HTTPD Config file SuppressLastModified
  3. Statements-------- Value Format -------------dynamic Rows ---------------0 Next Autoindex--- 6 how do i set the auto index back to 0 ?
  4. Here is my issue... My login script of course. I have a table like so called users... |ID|USERNAME|PASSWORD|USERLEVEL|EMAIL| |1 | farslasher | md5pass | 1 |a@a.com| |2 | rawr | md5pass | 1 |a@a.com| |3 | monkeym | md5pass | 1 |a@a.com| |4 | pistachio | md5pass | 1 |a@a.com| |5 | trianglema| md5pass | 1 |a@a.com| My login script has an admin section which is able to delete a user, so for example, I delete username = 'rawr'(Row 2). My new output is: |ID|USERNAME|PASSWORD|USERLEVEL|EMAIL| |1 | farslasher | md5pass | 1 |a@a.com| |3 | monkeym | md5pass | 1 |a@a.com| // 2 was deleted |4 | pistachio | md5pass | 1 |a@a.com| |5 | trianglema| md5pass | 1 |a@a.com| then at the same time I update the table with this code. Code: $getid = "SELECT id FROM ".TBL_USERS." WHERE username = '$subuser'"; $result = $database->query($getid); $num = mysql_numrows($result); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $i++;} $adjust = "UPDATE users SET id=id-1 WHERE id > '$id'"; $database->query($adjust); // Done with that Id number stuff $q = "DELETE FROM ".TBL_USERS." WHERE username = '$subuser'"; $database->query($q); What the above codes to better explain is... $getid grabs the id of the user I selected to delete from table users (defined as TBL_USERS). $database->query is the database information and mysql_query() $num the if statement takes the query result from $getid and stores it to variable $id. $adjust updates the tables users so if i delete user that has an id of 3... it makes all users after 3... starting at 4, -1 to the id so the order is still correct. Then $q deletes the user. All is good Here is the new output of the table: |ID|USERNAME|PASSWORD|USERLEVEL|EMAIL| |1 | farslasher | md5pass | 1 |a@a.com| |2 | monkeym | md5pass | 1 |a@a.com| |3 | pistachio | md5pass | 1 |a@a.com| |4 | trianglema| md5pass | 1 |a@a.com| The issue you ask, Now if someone goes to register, they are counted as id 6.. Meaning this is the result after a new person registers: |ID|USERNAME|PASSWORD|USERLEVEL|EMAIL| |1 | farslasher | md5pass | 1 |a@a.com| |2 | monkeym | md5pass | 1 |a@a.com| |3 | pistachio | md5pass | 1 |a@a.com| |4 | trianglema| md5pass | 1 |a@a.com| |6 | newregist |newmd5 | 1 |n@n.com| the newly added row is counted as 6, since it auto increments. What i wanted to happen is that the new field be 5... likely nothing happened out of the ordinary. The reason by the way that i need this is i have a member list which shows the members of my site ordered by the user id, it would be odd if it was ordered as, 1,2,3,6,7,8,9,10,13,14,15,17. you get the point. Here is the users table i created: CREATE TABLE users ( id mediumint(10) NOT NULL auto_increment, username varchar(30), password varchar(32), userid varchar(32), userlevel tinyint(1) unsigned not null, email varchar(100), timestamp int(11) unsigned not null, primary key (id,username) ); much help would be appreciated on this. thanks.
  5. I making a small software. The user can give his or her time zone. But I don't know how to show the time with the change of the time zone. Can some one show me how to do it? Thank you,
  6. I have been trying to find a tutorial on how to display the first X words from a database entry, like google does with search "..."'s [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]PHP: Hypertext Preprocessor PHP is a server-side HTML embedded scripting language. It provides web developers with a full suite of tools for building dynamic websites: native APIs to ... How can this be acheived?
  7. WOW man what screwer's LOL everyone is tryin to get extra cash these days
  8. Is it possible, or worthwhile, to place objects in sessions or does it make more sense to just pass an array around and make an object when you need to? I tried to pass an object as a session variable, but that ended up needing the __autoload () function and even then it seemed to have lost all its data... Anyone have any suggestions?
  9. Im not sure but Ober is this how it works after it has expired the printer cant reed it ?
  10. Unfortunately once it's expired than it wont work its like trying to drink milk with an expired date it dosent taste right
  11. Go onto http://www.hp.co.uk and punch in your printer modle and you may be able to find the answers there or contact HP customer support.
  12. Last time this happend to me and I checked the bottom of the cartridge and there was some tape stuck on the bottom check to see if something is jammed ?
  13. Ok, I am getting the date like this $date = strtotime(date()); ok, there you have it, a Unix time stamp of the time, date, and everything else. From here, is this the best way to do calculations. Like if I wanted to tell when 48 hours had passed from this date, how do I go about doing that. I know for example if you wanted to add a day, you check on how many "number's" here are in a day and put + that number onto the strength. Can someone tell me some stuff about this, so I am more familiar with dates, before I start all of these calculations.
  14. Thanks for again for your advice
×
×
  • 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.