First of all, you cannot select from *. You can select * from table_name, but thats a different matter.
Secondly, what the hell is it you want to do? You're making about as much sense as a guinepig with a pancake on his head.
I'm guessing you want to update different tables with different rows from another table? Apart from the question why anyone would ever want to do something like that (only a retard makes more then one table for a certain data-type), its pretty simple: use
PHP Code:
while($result = mysql_fetch_assoc($query))
mysql_query("INSERT INTO table".$result['id']." (COLUMN NAMES)
VALUES ('$result[value1]', '$result[value2]')");