Quantcast
Channel: Microsoft Drivers for PHP for SQL Server forum
Viewing all articles
Browse latest Browse all 163

PHP - Error retrieving data

$
0
0

Hi,

I am trying to setup my sql express 2008 R2 setup to allow php access.  The following code seems to work:

-----------------------------------------------

$serverName = "myserver";

$connectionOptions = array("Database"=>"sakila");

$conn = sqlsrv_connect( $serverName, $connectionOptions);

if( $conn ) {

-----------------------------------------

However, the next section that retrieves data returns 0 rows. 

-------------------------------------

$resultdb = sqlsrv_query($conn, "Select * from UserNames");
$row_count = sqlsrv_num_rows($resultdb);

echo "num rows:";

---------------------------------------------------------------

I've tried looking at the sql_errors array, but it didn't display anything.  I've been searching for 2 days now for any solutions.  Any suggestions greatly appreciated.  

Thx in advance.



Viewing all articles
Browse latest Browse all 163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>