hello, I need some help on numbers. I need to get the number for next <?=$row['id'];?> PHP: and insert into <?=$row['reference'];?> PHP: this is not a problem. i can do this but <?=$row['reference'];?> PHP: number can not be higher than 999. so when <?=$row['id'];?> PHP: reaches 1000 <?=$row['reference'];?> PHP: should go back to 1. When <?=$row['id'];?> PHP: reaches 2000 <?=$row['reference'];?> PHP: should go back to 1. and so on.... Can anybody help me please. Thanks
Please explain your problem in more detail, here: <?=$row['id'];?> <?=$row['reference'];?> You are just echoing out the id an the reference i don't see how you are getting or inserting anything
you need something like if (reference > 999){ id = 1 } or the other way around...? from what I understood you need something like this.?! explain some more please.
but if he changes it to 1 .. then if he ever has to use it again, it will be labeled wrong in the database. Better to at least something strange like if ($row['reference'] > 999){ id = "1b" } then if you ever recall the data you'd have to unwrap it back to a integer.