E
E
Eugene2015-11-06 18:39:44
PHP
Eugene, 2015-11-06 18:39:44

Whether it is possible to receive from mssql_query all result at once in an array?

Good evening! Subject. I always bypassed the result like this
while ($arr = mssql_fetch_assoc($qry)) {
...
}
However, this time it did not take off, because the following construction was formed:
$qryAllRooms = mssql_query('SELECT property, type FROM dbo.ghinfo_rooms WHERE property = "' . $property . '"');
$con = dbconnect(array('srv' => $hotel, 'usr' => '123', 'pwd' => '312', 'dbn' => $hotel));
while ($room = mssql_fetch_array($qryAllRooms)) {
As you can see, between the iteration and the query, there is a connection to another database, and the rows from the query are not sorted out, Warning: mssql_fetch_array(): 7 is not a valid MS SQL-result resource. It is impossible to move the connection somewhere else,
In this regard, the question is: is it possible to somehow make an array from qryAllRooms at once? Of course, I can go through the fetch and manually make an array, but maybe there is some function built into PHP? They didn’t ban me on Google, but I didn’t find something (

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question