Okay. I am now having trouble on the coding part now! This is the code that i have got:
And i am getting the following error message:Code:<?php $serverName = "01itserver\SQLEXPRESS"; //serverName\instanceName $connectionInfo = array( "Database"=>"lansweeperdb", "UID"=>"networktest", "PWD"=>"password"); $conn = sqlsrv_connect( $serverName, $connectionInfo); $result = sqlsrv_query( $conn, 'select * from dbo.tblcomputers where computer = (PPS4)') $row = sqlsrv_fetch_assoc($result); echo($row['Computer']); ?>
Parse error: parse error in C:\DFSRoots\NewVis\Network\test.php on line 7
Missing a ; at the end of the $result line I think
I'd also stick a conditional check to ensure you're getting a result back before trying to fetch_assoc, just incase there's nothing there at some point and you get an error instead.
Last edited by Willott; 31st May 2012 at 01:47 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)