I had the same problem, i found that if you deleate any of your affiliates the problem starts. i fixed my problem of no id being generated by
1. deleating the sql database for affiliate scheme
2. re uploading all files for the affiliate scheme
3. using mysql dump to re install the database.
each time i tried to re up load the data base i got the message duplicate entry, so i left it for a few hours and tried again and it has worked for a week now with no problems. Just do not delete any signups!!!!
hope this helps :D