Jump to content
MakeWebGames

[Mccodes V2] How to get the users to fill up the ID's


Recommended Posts

Posted

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 ???

Posted

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:

Posted

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 :)

Posted

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

Guest Anonymous
Posted

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?

Guest Anonymous
Posted

Re: [Mccodes V2] How to get the users to fill up the ID's

Yes

Guest Anonymous
Posted

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

Posted

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?!

Guest Anonymous
Posted

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 ;)

Posted

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.

Guest Anonymous
Posted

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.

Posted

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

Guest Anonymous
Posted

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?

Posted

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

Posted

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:

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...