php-sqlsrv/test/bvt/pdo_sqlsrv/msdn_pdoStatement_fetchObject.phpt
2017-06-02 15:59:44 -07:00

19 lines
438 B
PHP

--TEST--
fetches the next row as an object
--SKIPIF--
--FILE--
<?php
require('connect.inc');
$conn = new PDO( "sqlsrv:server=$server ; Database = $databaseName", "$uid", "$pwd");
$stmt = $conn->query( "select * from Person.ContactType where ContactTypeID < 5 " );
$result = $stmt->fetchObject();
print $result->Name;
//free the statement and connection
$stmt=null;
$conn=null;
?>
--EXPECT--
Accounting Manager