How to loop through result set objects using mssql_fetch_array()?



How to loop through result set objects using mssql_fetch_array()?..

Answer / Shweta Paedey

In PHP, you can't use mssql_fetch_array() with SQL Server. Instead, you should use the PDO_SQLSRV extension or the SQLSRV functions. Here's an example of how to loop through a result set using sqlsrv_fetch_array():nn```phpn$stmt = sqlsrv_query($conn, $sql);nwhile ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) {n // Do something with the row here.n}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

What are the steps you will take to improve the performance of a poor performing query?

1 Answers  


what is spatial nonclustered index

0 Answers  


What is INTVAL( )and where we use Plz any body help me

1 Answers  


What is the difference between functions and stored procedures?

1 Answers   Accenture,


How to provide values to stored procedure parameters in ms sql server?

1 Answers  


What is an inner join?

1 Answers  


What is the advantage of sql server?

1 Answers  


how to get the automatic backup of the database in the sql server

4 Answers  


What is log in sql server?

1 Answers  


What is the use of keyword with encryption. Create a store procedure with encryption?

1 Answers  


how will add additional conditions in sql?

1 Answers   Amdocs, Apps Associates,


as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration

1 Answers  


Categories