It really is this easy!
Use this in your PHP code, or use direct, as sql.
1 2 3 4 5 6 7 |
mysql_query('SET @i = 0'); $query = "UPDATE $listsentto SET todo_id=(@i:=@i+1);"; mysql_query($query) OR die(mysql_error()); echo "<br>Records Updated: ".$raf = mysql_affected_rows(); |