PHP connects to the database and it works successfully calls odbc_tables.
BUT if I do a simple 'select * from tablename', I get
select * from LOANINFO
Warning: odbc_do() [function.odbc-do]: SQL error: [FairCom][FairCom ODBC Driver][FairCom File Library]No such table or object., SQL state S0002 in SQLExecDirect in C:\Users\oky\htdocs\mortgage\melapi.php on line 27
Warning: odbc_fetch_object(): supplied argument is not a valid ODBC result resource in C:\Users\oky\htdocs\mortgage\melapi.php on line 28
WHYYYYYYY?
It connects, thats why I get all the tables names. Why the select does not work???
Code: Select all
$db = odbc_connect('MELAPI','','');
$result = odbc_tables($db);
$tables = array();
while (odbc_fetch_row($result)){
if(odbc_result($result,"TABLE_TYPE")=="TABLE")
echo"<br>".odbc_result($result,"TABLE_NAME");
}
$sql = "select * from LOANINFO";
$qrs=odbc_do($db,$sql);
while ($obj = odbc_fetch_object($qrs))
print_r($obj);
odbc_close($db);