I'm creating an online raffle system in PHP and MySQL. Firstly I create the prize draw where I inform the prize and its details, among them the amount of coupons, starting in a specific number. For simplicity, I'll raffle a car and sell 800 numbers, which should start at 101 and go up to 900 (101, 102, 103, ... 899, 900). In another table, I need to generate these numbers automatically, and in each of them I will have the name of the buyer of this number, phone and email, which will be filled in later. How do I generate this sequence and write to the database? The table looks like this:
CREATE TABLE 'numeros' (
'id' int(11) NOT NULL,
'rifa' varchar(50) NOT NULL,
'numero' decimal(8,0) NOT NULL,
'status' varchar(50) NOT NULL,
'nome' varchar(250) NOT NULL,
'celular' varchar(50) NOT NULL,
'email' varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Only the number field must be generated at this stage, in addition to id, of course. I tried different ways, I could not. I gratify your help.