update sequence number in database mysql php
<p>I have product list in database and want to mange sequence from the administrator.</p>

<p>If i enter new product in database it will be come 1. (there is already 6 record 1,2,3,4,5,6) new product will be sequence 1. new sequence will be 1,2,3,4,5,6,7 and new record will be come on 1.</p>

<p>if during insert new record i want to come on 3rd position than other position number 3 become 4 and position number 4 become 5 and so on.</p>

<p>I am using MySQL and PHP.</p>

<p>I got the answer when admin will add the product we got the new product always as 1st position by using below query:-</p>

<p>// be default position will set as 0</p>

<p>insert into user(name,inum) values('product name','0');</p>

<p>SET @i = 0;</p>

<p>UPDATE user SET inum = @i := @i + 1 ORDER BY inum;</p>

<p>What i need to do if i want to insert new record on position 3 and rest of the record position will increase by 1.</p>