When pdo accesses the SQL Server stored procedure, it cannot obtain the result set. if the stored procedure directly accesses and returns the table, for example, select & nbsp; * & nbsp; from & nbsp; table & nbsp ;, yes, the result set can be obtained, but if a temporary table is used, such as: select & nbsp; * & nbsp; into & nbsp; # t1 & nbsp; from & nbsp; table1select & nbsp; * & nbsp; f pdo cannot obtain the result set when accessing the SQL Server stored procedure
If the stored procedure directly accesses and returns the table,
For example, select * from table can obtain the result set,
However, if a temporary table is used,
For example:
Select * into # t1 from table1
Select * from # t1
No. why?
------ Solution ----------------------
To prevent SQL attacks, php restricts the execution of only one SQL command by one database operation method (function ).
I hope you will notice this.
If
Select * into # t1 from table1
Select * from # t1
Is the content in the stored procedure
The returned result set contains two query results.
You need to use PDOStatement: nextRowset to traverse