Jump to content

autoincrementing a num every year.


vidhya

Recommended Posts

hi,

 

i have a table with 5 usersid.each user will be given a rank(1 -10) while joining.after one year completion of joining the rank of the users shd be autoincremented by itself without any triggers.(suppose a users has rank 5 while joining, the next year it shd be 6).pls help i don know how to go abt this.

is there a way to do this without any triggers.pls help me with the code.

thanks in advance

Link to comment
Share on other sites

Just have another field in your database called next_rank.  When they sign up take the current date + 1 year.  When they hit that date (now() = next_rank) then you give them the next rank and increment next_rank by another year.  You could do this whenever they sign in or better yet run a cron job to check everyday.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

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

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.