Hi, Thanks for the trick. I took the query to copy the data outside of the loop, and it is now working! Alice > Date: Fri, 14 Nov 2008 14:07:27 +0200 > From: tgol@xxxxxxxxxx > To: dmagick@xxxxxxxxx > CC: php-db@xxxxxxxxxxxxx; ajwei@xxxxxxxxxxxxx > Subject: Re: Copying Data From One Table To Another Table > > > >>>> $result3=mssql_query($query3) or die ("The query has failed"); > >>>> > > > > <snip> > > > > > >> http://dev.mysql.com/doc/refman/5.0/en/insert-select.html > >> > > > > Ah - the OP isn't using mysql, it's ms-sql. > > > > > > > > Oups didn't notice that :-) . > > -- > Thodoris > _________________________________________________________________ Use Messenger to talk to your IM friends, even those on Yahoo! http://ideas.live.com/programpage.aspx?versionId=7adb59de-a857-45ba-81cc-685ee3e858fe