From: Alex M. <al...@no...> - 2011-03-27 20:14:37
|
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 |