Re: mdbtools with php

Alex Mayrhofer <[email protected]> Sun, 27 Mar 2011 22:14:22 +0200
Newsgroups gmane.comp.db.mdb-tools.devel
Message-ID <[email protected]>
On 26.03.2011 21:15, Dale Scott wrote:
> Hi, how is mdbtools being used with php? I first tried pecl-mdbtools.
> Now I'm trying ODBC (via unixODBC). Are there other and/or better methods?
>
> Also, I'm having trouble with either unixODBC or mdbtools segfaulting
> when I try to open a database, so I'm rebuilding everything from scratch
> on a new install of FreeBSD-7.4-RELEASE with latest ports to make sure I
> don't have a problem with wrong versions of libraries or something. If
> anyone has any suggestions, I'm all ears (it will be tomorrow until I
> can run the tests again).

Hello Dale,

i'm using PECL mdbtools on Linux (both versions 0.5.x and 1.0.0). It 
works pretty well, except that you cannot open more than one table at a 
time, and that there are (or have been) issues with long MEMO fields in 
databases.

I'm using code like this (first script, still used for debugging):

<?

dl('mdbtools.so');

$dbh = mdb_open("../uploads/test.mdb");

$t = mdb_table_open($dbh,'TESTTABLE');

$count = 0;
while ($r = mdb_fetch_assoc($t)) {
         $count++;
	print_r($r);
}

print "FETCHED $count \n";

mdb_table_close($t);

mdb_close($dbh);

?>

hope that helps,

Alex

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar