What is the error in php?

In this php program:

<?php
// connect to DSN MSSQL with a user and password
$connect = odbc_connect("DSNNAME", "miki", "84139") or die ("couldn't connect");
ini_set('odbc.defaultrl','65536');
odbc_exec($connect, "use SwitchCenterDB");
$result = odbc_exec($connect, 'show tables');
while(odbc_fetch_row($result)){
...
}
odbc_free_result($result);
odbc_close($connect);
?>[Mon Mar 03 11:49:59 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/ttc.php on line ...

there is an error:

The error

AaronHorne's picture

$result = odbc_exec($connect, 'show tables');

This is where the error is. I don't think 'show tables' is a valid parameter here.

Free Dummies Books
Continuous Engineering

Learn:

  • What continuous engineering is
  • How to continuously improve complex product designs
  • How to anticipate and respond to markets and clients
  • How to get the most out of your engineering resources

Get your free book now

Sponsored by IBM

Free Dummies Books
Service Virtualization

Learn to:

  • Define service virtualization
  • Select the most beneficial services to virtualize
  • Improve your traditional approach to testing
  • Deliver higher-quality software faster

Get your free book now

Sponsored by IBM