I want to connect to my MS Access Database via PHP (7.2.10), SLE 12.3. For this I'm using the libmdbodbc.so.1 driver which comes with package libmdbodbc1 0.7-3.1 (Source: mdbtools-0.7-3.1). Setup is done in unixODBC config: /etc/unixODBC/odbcinst.ini.
[MdbToolsOdbc]
Description = MDBTools ODBC Driver
Driver = libmdbodbc.so.1
Setup = libmdbodbc.so.1
The connection to the database and getting data via commandline (isql) is possible and does not return error.
But when I'm trying to execute a SQL query via PHP (connection done via: odbc_connect(Driver=MdbToolsOdbc;DBQ=%s, null, null);)
odbc_exec($connection, "SELECT id FROM table");
I got an error "Allowed memory size of 2097152 bytes exhausted (tried to allocate 140 Tbytes)".
The issue is still mentioned here:
https://github.com/brianb/mdbtools/issues/99
https://bugs.php.net/bug.php?id=75013&thanks=3
Does anybody know a solution or workaround for the issue?
Would be nice to get some response!
Thank you and best!
Use PDO instead: https://www.php.net/manual/en/ref.pdo-odbc.php
This works for me using a connection to a Filemaker database.