ALTER TABLE tbl_poll3 ADD COLUMN new_id INT NOT NULL;<br />
SET @x = 0;<br />
UPDATE tbl_poll3 SET new_id = (@x:=@x+1) ORDER BY php_framework ASC;<br />
ALTER TABLE tbl_poll3 ADD PRIMARY KEY new_id (new_id);<br />
ALTER TABLE tbl_poll3 CHANGE new_id new_id INT NOT NULL AUTO_INCREMENT;