sqlsrv_query resource is unknown when returned
<p>I'm having an issue with <code>sqlsrv_query();</code></p>

<p>I dont think this is a duplicate as i have been searching through other questions, but if it is i do apologise.</p>

<p>I have two php files one with the databse functions and one using them, the database file is included in the top of the file using it.</p>

<p>In the databse file i have two functions (Along with other connection functions);</p>

<pre><code>function database_GetData($sql) {
    $connection = database_GetDatabaseConnection();
    return sqlsrv_query($connection, $sql);
}

function database_ReadData($rs) {
    if (!$rs)
        return false;
    $data = sqlsrv_fetch_array($rs);
    return $data;
}
</code></pre>

<p>The issue is that the <code>database_GetData($sql)</code> returns the resource but it is "unknown". If i print the <code>sqlsrv_query($connection, $sql)</code> result in the function or do something along the lines of <code>sqlsrv_fetch_array(sqlsrv_query($connection, $sql))</code> within the function i get the expected result but as soon as i return the resource it gets messed up. The connection is all fine as i get the expected result but cannot return it. I would like to keep the functions the same as they are used throughout the application.</p>

<p>Is there any reason why a result of <code>sqlsrv_query($connection, $sql)</code> would get set to 'unknown' once returned from <code>database_GetData($sql)</code> function?</p>
