ThinkPHP
$table_name='autoid_'.$name;
$auto=M($table_name);
mysql_query("LOCK TABLES `".$table_name."` WRITE");
$result=$auto->find();
$autoid=$result['id'];
$sava_id=$autoid+$num;
$result=$auto->execute("UPDATE `".$table_name."` SET `id`='".$sava_id."'");
mysql_query("UNLOCK TABLES");