through phpmydamin is there any way to set up a table so that a column will increment accourding to the setting of another column?
so for eg?
column A contains ENUM a,b,c and column B contains INT
column B needs to be auto incremented.
so if there were 4 a's set in A and 2 b's, i inserted another row setting A to be 'b', can i get B to auto increment according to what value would be next for the b's?
make sense? lol.
Auto incrementing.
Re: Auto incrementing.
Not reallyTorniquet wrote:make sense? lol.
No, but can you not make the comparison with php and decide on the value to insert ? Or could you not ge the same data using mysql functions when selecting ?Torniquet wrote:through phpmydamin is there any way to set up a table so that a column will increment accourding to the setting of another column?
Re: Auto incrementing.
well i have a mysql driven dynamic menu system. (there is a reason for it, and it is easier than making it static for its use lol)
The idea is that A would be the menu selector, and B is the items position. so if i am putting in menu items, the position needs to be different. Just thought it might be easier to set phpmyadmin to do it rather than faf about with a script.
I will have to make one earlier than intended now lol.
The idea is that A would be the menu selector, and B is the items position. so if i am putting in menu items, the position needs to be different. Just thought it might be easier to set phpmyadmin to do it rather than faf about with a script.
I will have to make one earlier than intended now lol.
Re: Auto incrementing.
phpmyadmin is just an interface to the mysql server, it cant do anything. There may be some obscure MySQL feature that lets you do this but I don't know of it.