Adding values starting from 0001
#1

Already started and got stuck here:
pawn Код:
if(dialogid == 23)
{
    if(response)
    {
        switch(listitem)
        {
            case 0:
            {
                //new Year, Month, Day;
                //getdate(Year, Month, Day);
                //new dateform[100];
                //format(dateform,sizeof(dateform), "%02d/%02d/%d", Day, Month, Year);
                new form2[30];
                format(form2,sizeof(form2), "No Transaction");
                new bankquery[300];
               
format(bankquery, sizeof(bankquery), "INSERT INTO `pinfo`  (`id`, `name`, `money`, `latesttransaction`) VALUES ('%d', '%s', 0, '%s')", /*????????*/ , escpname(playerid), form2);
I want to insert a value in the 'id' wherein it starts 0001. After which it then proceeds to 0002 so on and so forth. Also, if there is a deleted player how can I 'fill' a number in? For example if ID 0002 will be deleted, the next player who'll register will get that special ID instead of 0003.

I'm guessing I have to loop through all of the rows in the table to find the empty slot in which to be filled in. Could anyone show me about how would I be going to do that?

Cheers to anyone who's willing to help
Reply


Messages In This Thread
Adding values starting from 0001 - by Neil. - 16.02.2013, 15:33
Re: Adding values starting from 0001 - by Vince - 16.02.2013, 15:46
Re: Adding values starting from 0001 - by Neil. - 16.02.2013, 15:50

Forum Jump:


Users browsing this thread: 2 Guest(s)