Published on Linux Journal (http://www.linuxjournal.com)
What is the error in getting an info from MSSQL? Enclosed herewith: an error message and source of the program
By ymengel
Created 2008-02-24 02:07

[Fri Feb 22 12:54:15 2008] [error] [client 132.64.4.16] PHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [unixODBC][FreeTDS][SQL Server]Could not find stored procedure 'SHOW'., SQL state 37000 in SQLExecDirect in /srv/www/htdocs/hu/Proj1/test.php on line 9
[Fri Feb 22 12:54:15 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/test.php on line 10
[Fri Feb 22 12:54:15 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/test.php on line 14

The test source program is:

--- begin odbctest.php---
<?
// connect to DSN MSSQL with a user and password
$connect = odbc_connect("DSNNAME", "user", "passwd") or die
("couldn't connect");
print "connection ok";
odbc_exec($connect, "use SwitchCenterDB");
print "SwitchCenterDB ok";
$result = odbc_exec($connect, "SHOW TABLES");
while(odbc_fetch_row($result)){
print(odbc_result($result, "CompanyName") .
' ' . odbc_result($result, "ContactName") . "\n");
}
odbc_free_result($result);
odbc_close($connect);
?>
--- end odbctest.php --

__________________________

‹ What is the error in php? [1] configure: error: Cannot find ldap libraries in /usr/lib › [2]

Source URL: http://www.linuxjournal.com/content/what-error-getting-info-mssql-enclosed-herewith-error-message-and-source-program

Links:
[1] http://www.linuxjournal.com/content/what-error-php
[2] http://www.linuxjournal.com/content/configure-error-cannot-find-ldap-libraries-usrlib