SpEcKs Posted February 17, 2009 Posted February 17, 2009 I need help because on my site i have deleted some users and when another user registers it will go up the next ID. How would i make it so when a new user registers they use the ID that i had just deleted??? Does anyone know ??? Quote
Jordan Palmer Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Dont delete users :lol: Use a different method Ie, IP ban, Hmm, Maybe even use in header if['deleted'] == 1) { die("Your account is on our server but is marked as deleted, Mail staff@{$domain} stating your username and player ID");} ALTER TABLE `users` ADD `deleted` int(11) NOT NULL default '0', Please note Im not sure if this would work, I'd at least try tho :mrgreen: Quote
SpEcKs Posted February 17, 2009 Author Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's i was only deleting them because they were testers for when i was testing things such as: Register Attack Marriage Send crystals Send money and other things So does anyone know how to do this because i really need it :) Quote
Jordan Palmer Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's i was only deleting them because they were testers for when i was testing things such as: Register Attack Marriage Send crystals Send money and other things So does anyone know how to do this because i really need it :) You can do it via Database, But theres a risk you'll fuck it up... Just do a master reset Quote
SpEcKs Posted February 17, 2009 Author Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's and how do i do that ??? Quote
SpEcKs Posted February 17, 2009 Author Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's So how do i do this mass reset because thats what i need to do Quote
Jordan Palmer Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Learn.. Or go to database and empty all your tables :) Quote
Guest Anonymous Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Just exactly what is the point of this query? The answer is surprisingly simple given a little time spent with the MySQL manuals, however - I see absolutely zero gain. Actually IIRC I've even posted on this subject here.... INSERT INTO Users (UserID, Name, ...) VALUES (NULL, "Tom", ...); INSERT INTO Users (UserID, Name, ...) VALUES (NULL, "Dick", ...); INSERT INTO Users (UserID, Name, ...) VALUES (NULL, "Harry", ...); SELECT UserID, Name FROM Users; 1 Tom 2 Dick 3 Harry DELETE FROM Users WHERE UserID = 2 INSERT INTO Users (UserID, Name, ...) VALUES (NULL, "Alice", ...); INSERT INTO Users (UserID, Name, ...) VALUES (NULL, "Bob", ...); SELECT UserID, Name FROM Users; 1 Tom 3 Harry 4 Alice 5 Bob What's the problem? the ID (assuming an unsigned) can contain a number far higher than you can count to... therefore it's not an issue. Why are you even showing the ID #'s themselves? Exactly what purpose do they serve? Quote
SpEcKs Posted February 17, 2009 Author Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's is there just anything i can do to get the ID's that arent being used. used Quote
Guest Anonymous Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Yes Quote
SpEcKs Posted February 17, 2009 Author Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Can you Please post it here or tell me what to do or both Quote
Guest Anonymous Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's IIRC ... SELECT l.userid + 1 AS start, Min(fr.useridid) - 1 AS stop FROM users AS l LEFT OUTER JOIN users AS r ON l.userid = r.userid - 1 LEFT OUTER JOIN users AS fr ON l.userid < fr.userid WHERE r.userid IS NULL AND fr.userid IS NOT NULL GROUP BY l.userid, r.userid; should give you a clue Quote
SpEcKs Posted February 17, 2009 Author Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Nope no idea Nyna please can you just tell me i am not as good as you lol Quote
Jordan Palmer Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Nope no idea Nyna please can you just tell me i am not as good as you lol No one on the forums is expeienced as Nyna, So LEARN! you want us to put our butts out for you? Go learn?! Quote
Guest Anonymous Posted February 17, 2009 Posted February 17, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Try the query ... see what it returns .. then think about how to use that in your own code. I could install it but I'd charge so much your grandchildren would be in debt ;) Quote
Haunted Dawg Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's DEFINE SELECT l.userid + 1 AS start, Min(fr.useridid) - 1 AS stop FROM users AS l LEFT OUTER JOIN users AS r ON l.userid = r.userid - 1 LEFT OUTER JOIN users AS fr ON l.userid < fr.userid WHERE r.userid IS NULL AND fr.userid IS NOT NULL GROUP BY l.userid, r.userid; Can define what it does u suppose. Left Outer Join.. now ive seen it all. LEFT INNER JOIN RIGHT JOIN INNER JOIN LEFT OUTER JOIN Couple other's. I suppose there are alot of "Joins" to the sql world eh. Quote
Guest Anonymous Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's That's what comes of actually reading the manual Killah .... And that stuff is really a no-brainer, but the OP is asking the wrong question. Quote
Haunted Dawg Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's There is actualy a modification here on CE made by oxidati0n. It actualy use's old userid's. Because when you delete an ID that id get's inserted into a Table, at registration it check's for the ID and it asign's it to that player. How ever he can alway's set the auto increment to null. But if he has 1 Player 2 Player 4 Player And then it's like 8 row's deleted it should insert 1 Player 2 Player 4 Player 9 Player. With auto increment set to null it should be 1 Player 2 Player 4 Player 5 Player Quote
Guest Anonymous Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's ffs - I've given the answer twice now -- how many times do I have to write this crap out? Quote
Karlos Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Can define what it does u suppose. Left Outer Join.. now ive seen it all. LEFT INNER JOIN RIGHT JOIN INNER JOIN LEFT OUTER JOIN Well i haven't seen these either but here are some links i have come up with: Left Inner Join - Couldn't find one. Right Join Inner Join Left Outer Join Quote
Haunted Dawg Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's My link i gave you on msn show you them briefly ;) Quote
Karlos Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's I was looking for a bit more in-depth view though Quote
SpEcKs Posted February 18, 2009 Author Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's So what is the actual thing i have to do and where do i put that please i really need that Quote
(((TOLK))) Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Try the query ... see what it returns .. then think about how to use that in your own code. I could install it but I'd charge so much your grandchildren would be in debt ;) efiin hell, that's a good one, i could use that sumtym, lol :mrgreen: :-D :lol: Quote
Karlos Posted February 18, 2009 Posted February 18, 2009 Re: [Mccodes V2] How to get the users to fill up the ID's Try the query ... see what it returns .. then think about how to use that in your own code. I could install it but I'd charge so much your grandchildren would be in debt ;) MySQL returned an empty result set (i.e. zero rows). (Query took 0.0183 sec) SQL query: SELECT l.userid +1 AS START , Min( fr.userid ) -1 AS STOP FROM users AS l LEFT OUTER JOIN users AS r ON l.userid = r.userid -1 LEFT OUTER JOIN users AS fr ON l.userid < fr.userid WHERE r.userid IS NULL AND fr.userid IS NOT NULL GROUP BY l.userid, r.userid LIMIT 0 , 30 I still have no clue what this does xD Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.