[Tue Mar 04 14:10:00 2008] [error] [client 132.64.4.16] PHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [unixODBC][FreeTDS][SQL Server]Invalid object name 'DeviceView'., SQL state S0002 in SQLExecDirect in /srv/www/htdocs/hu/Proj1/ttb.php on line 7
[Tue Mar 04 14:10:00 2008] [error] [client 132.64.4.16] PHP Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in /srv/www/htdocs/hu/Proj1/ttb.php on line 8
[Tue Mar 04 14:10:00 2008] [error] [client 132.64.4.16] PHP Warning: odbc_free_result(): supplied argument is not a valid ODBC result resource in /srv/www/htdocs/hu/Proj1/ttb.php on line 12

Source:

-- begin odbctest.php---
<?
// connect to DSN MSSQL with a user and password
$connect = odbc_connect("DSNNAME", "miki", "84139") or die ("couldn't connect");
odbc_exec($connect, "use SwitchCenterDB");
//$result = odbc_exec($connect, "SELECT * FROM DeviceView");
$result = odbc_exec($connect, "SELECT address, portalias FROM DeviceView");
while(odbc_fetch_row($result)){
print(odbc_result($result, "address") .
' ' . odbc_result($result, "portalias") . "\n");
}
odbc_free_result($result);
odbc_close($connect);
?>
--- end odbctest.php --