Hey I've got a strange problem with my register page. When I press register it says  thanks for register......etc. but when I go inside my database it hasn't set any id for the newplayer, I mean after the other players if you know what I mean. If there's 2 players already it doesn't set any id on it. Just "0"
Hope you know what I mean.
Thanks
Andrew
			
			
									
						
										
						Id problem
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Id problem
Are you sure you set it to automatically increment, and set it as the table key? 0 is the default value, so it isn't being incremented. After you make sure it is set to automatically increment, make sure you aren't setting a value to it, and, in fact, aren't referencing the column at all in your INSERT statements. You just pretend that column doesn't even exist when adding new records.
			
			
									
						
							The indelible lord of tl;dr
			
						Re: Id problem
It must be the Primary key as well.
			
			
									
						
							Fighting for peace is declaring war on war. If you want peace be peaceful.
			
						- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Id problem
Yeah, that is what I meant. I can't remember, are there kinds of keys besides Primary?
			
			
									
						
							The indelible lord of tl;dr
			
						Re: Id problem
Yes there are, Primary, Index and Single (I'm not short if that's the names of phpmyadmin English version...)
			
			
									
						
							
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Id problem
Weird lol. I have never had any use for any of them besides Primary. Thanks, though!
			
			
									
						
							The indelible lord of tl;dr
			
						Re: Id problem
PK`s usualy also have the UNIQUE attribute. Which is another index you can use.
			
			
									
						
										
						

