Need to insert unique values in two ID columns but can only have one autoincremental index
Hi Ray, ignore my last post which I've now deleted as I think I've worked out what my issue is.
I have 3 ID columns in a database - the main index ID which is an autoincrement column, and two other ID columns which in an ideal world would also be incremental but you can't have more than one autoincrement column in a database. I thought I could maybe use the random password generator to generate random numbers to insert in the column, but I've already used the rpw generator on the site so I get an error when I try to generate another one. How would I go about doing this, or is there another solution you can think of? Basically the other two columns (both integer type) already have data in some of the rows which needs to remain untouched, but if the rows are updated I would like unique numbers to be added to them both.
**UPDATE** I think I've solved it. I added two hidden fields with the value <?php echo rand(11000,99000);?> and set these to only show if the column values are currently empty. Then I added the post values to the update behavior. That way it will only write numbers to those fields if they are blank.