Issue report by Nick Nick
Version
12v3Operating system version
Windows 7 32 bitDescription of the issue
I've tried to use php odbc to connect to filemaker databasewith the following piece of code:
$server = <ipServer>;
$database = "<dbName";
$user = "<user>";
$password = "<password>";
$connection = odbc_connect("Driver=FileMaker ODBC;Server=$server;Database=$database;", $user, $password);
$sql = "SELECT <FIELDS> FROM <TABLE> WHERE <FIELD> = ?";
$cond = <conditionValue>;
$statement = odbc_prepare($connection, $sql);
if(!$statement) {
die("could not prepare statement ".$statement);
}
$resultSet = odbc_execute($statement, array($cond));
odbc_close($connection);
but this row:
$resultSet = odbc_execute($statement, array($cond));
give the following error:
Warning: odbc_execute() [function.odbc-execute]: SQL error: [FileMaker][FileMaker] No cursor open for statement, SQL state HY000 in SQLFreeStmt in test.php
obviously this problem is the same if avoid the paramaters, but not the odbc_prepare because is necessary
i saw the source of odbc_execute() from here:
http://pr-web-01.qatar.cmu.edu/src/php-5.2.6/ext/odbc/php_odbc.c
and saw that the problem was connected with this instruction:
/* Close cursor, needed for doing multiple selects */
rc = SQLFreeStmt(result->stmt, SQL_CLOSE);
Could you help me to solve?