I don't understand why this piece of code miserably fails.The first pass of the for() loop works fine but in the second pass mssql_query() fails, no errors are reported and the program just die.\[code\]for($i=0; $i <2; $i++){ $query = "SELECT * FROM Viaggio "; $result = mssql_query($query, $link) or die("query fallita:".msql_error()); if( mssql_num_rows($result) ){ while($row = mssql_fetch_array($result, MSSQL_ASSOC)){ echo 'blablablabla' . $row[some_index] . 'blabla'; } } }\[/code\]I don't know why this happen, It's works with all the other tables in my database except for Viaggio.This is the CREATE TABLE query directly from msSQL:\[code\]SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING ONGOCREATE TABLE [dbo].[Viaggio]( [codViaggio] [bigint] IDENTITY(0,1) NOT NULL, [data] [smalldatetime] NOT NULL, [oraArrivo] AS ([data]+[durata]), [corsaExpress] [bit] NOT NULL, [durata] [time](7) NOT NULL, [fascia] [nvarchar](50) NOT NULL, [distanza] [char](3) NOT NULL, [nave] [nvarchar](50) NOT NULL, [partenza] [nvarchar](50) NOT NULL, [arrivo] [nvarchar](50) NOT NULL, CONSTRAINT [PK_Viaggio] PRIMARY KEY CLUSTERED ( [codViaggio] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOSET ANSI_PADDING OFFGOALTER TABLE [dbo].[Viaggio] WITH CHECK ADD CONSTRAINT [FK_Viaggio_Nave] FOREIGN KEY([nave])REFERENCES [dbo].[Nave] ([nome])ON UPDATE CASCADEGOALTER TABLE [dbo].[Viaggio] CHECK CONSTRAINT [FK_Viaggio_Nave]GOALTER TABLE [dbo].[Viaggio] WITH CHECK ADD CONSTRAINT [FK_Viaggio_Rotta] FOREIGN KEY([partenza], [arrivo])REFERENCES [dbo].[Rotta] ([pPartenza], [pArrivo])ON UPDATE CASCADEON DELETE CASCADEGOALTER TABLE [dbo].[Viaggio] CHECK CONSTRAINT [FK_Viaggio_Rotta]GOALTER TABLE [dbo].[Viaggio] WITH NOCHECK ADD CONSTRAINT [FK_Viaggio_Tariffa] FOREIGN KEY([fascia], [distanza])REFERENCES [dbo].[Tariffa] ([fascia], [distanza])ON UPDATE CASCADEGOALTER TABLE [dbo].[Viaggio] CHECK CONSTRAINT [FK_Viaggio_Tariffa]GO\[/code\]Thank you very much[EDIT] I just tried to use mssql_free_result() but also this function crash the program.