ODBC DERBY DRIVER for PHP

纵然是瞬间 提交于 2020-01-05 05:54:49

问题


I installed easysoft odbc derby driver in windows 7 and try to connect to derby database after I configure on ODBC Data Source Administrator DSN and connection succeed.

then i tried on php script

 //commz is the DSN name ind ODBC data source admin 
$connection = odbc_connect("commz",$user, $password);

if ($result = odbc_exec($connection, "SELECT * FROM ADDRESSBOOK"))
    print "Command executed successfully<BR><BR>";
else
    print "Error while executing command<BR><BR>";

  // Print results
  while(odbc_fetch_row($result))
    print odbc_result($result, 1) . "   " . odbc_result($result, 2) . "   " . odbc_result($result, 3) . "   " . odbc_result($result, 4) . "   " . odbc_result($result, 5) . "<BR>";

  odbc_close($connection);
  print "<BR>Connection closed.";

after i run this script this msg appear

Connected to datasource

Warning: odbc_exec(): SQL error: [Easysoft][ODBC-Derby Driver][DRDA]General error: unexpected command (dss not returned), SQL state HY000 in SQLExecDirect in C:\xampp\htdocs\test\index.php on line 36 Error while executing command

Warning: odbc_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\test\index.php on line 45

Connection closed.

any advise regarding to this?

Thanks!


回答1:


Best thing to do, is send a driver log of the operation to support@easysoft.com and we will take a look at whats going on. I will post whatever we find back here.

To get the log, add to your DSN in odbc.ini file:

Logging = Yes
LogFile = /tmp/drb.log


来源:https://stackoverflow.com/questions/16955368/odbc-derby-driver-for-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!