Looping to update article codes on one server based on queries on another server
if you can access the second database from the same connection 

use this query 

UPDATE articles a1 inner join YOURDB.articles a2 on a1.id=a2.id
set a2.artcode = a1.artcode


but if your database is in another server i'm afraid you can't make it in one query