Page 1 of 1

PHP and ODBC on a single PowerBook G4 (OS X)

Posted: Tue Jul 22, 2003 5:18 am
by ::navarre::
Hi to all,
until yesterday I write the PHP code on my PBG4 and test it on an old Pentium II WinNT server sp 6 on the lan at office (The firm wher I work, use a WinNT server for the web on-line).

Finally I install and run locally on my PBG4 the PHP 4.3.1 on the APACHE server preinstalled on Mac OS X.

THIS IS THE QUESTION:
Someone know how to use locally also the .mdb files (files MS Access) on my mac from the PHP? (so I can test all the site, with the odbc function of php, locally.. without testing on a server PC?)

... son I can work evrywhere...also at home... without a PC server :)


COULD U HELP ME?

thx

::navarre::
navarre@estranet.it


P.S. I found on sourceforge 2 stable project, on ODBC for MacOSx... but I don't undersand nothing ... :D
Too technical... :)
http://sourceforge.net/projects/unixodbc/
http://sourceforge.net/projects/newlisp/
..and I also try to install iODBC, but I need the router... on a server PC, so Is not the solution...[/b]

Posted: Tue Jul 22, 2003 8:29 am
by cactus
What you need is a ODBC manager/drivers for OSX, not being a Mac user I can't direct you to a specific source but this should help:

Ref : http://www.google.com/search?num=100&hl ... +X&spell=1

Have a look on the Microsoft site, they may have the ODBC drivers for Mac OS X.

Hope this helps.

Regards,

Posted: Tue Jul 22, 2003 8:41 am
by Stoker
You probably want http://www.iODBC.org
there is also UnixODBC which is the default one used by debian, but the PHP manual does not indicate that they support it, and I have had some mysterious results when using Debians PHP 4.1.2 ->UnixODBC->Openlink generic ODBC-ODBC->OpenlinkRequest broke->Jet/MS-Access (windows)

Posted: Tue Jul 22, 2003 9:44 am
by ::navarre::
FIRST OF ALL THX of so speedly answers...
then...
cactus wrote:What you need is a ODBC manager/drivers for OSX, not being a Mac user I can't direct you to a specific source but this should help:
Yes, I found something, but all the drivers and manager act as a 'GATEWAY' to the Microsoft ODBC control panel, or to other 'server' application on a PC. I need something local on my PBG4 to read the MS Access Files through the PHP (with the standard odbc functions of php such as: odbc_connect, odbc_fetch_row...)


and..
Stoker wrote:You probably want http://www.iODBC.org
there is also UnixODBC which is the default one used by debian, but the PHP manual does not indicate that they support it..
Yes but the only 'ready-app' use a ROUTER ODBC, an application that u must install in a PC to read with a mac the file pointed trough something like ODBC DNS.


:)

Ther isn't a solutions? :)

thx.

::navarre::

Posted: Tue Jul 22, 2003 10:18 am
by cactus
To try and find a solution to your problem, could you explain whether its your code that is more important or the data store ? I ask this because it may be easier to export the data as CSV or TSB (comma/tab separated values) and then import that into mySQL (for example) which can then be handled by PHP in the usual way.

The issue arrises if you intend to move your code over to a production environment where is needs to use ODBC, rather than exporting the new data from mySQL to ODBC.

I'm just waffling!

Regards,

Posted: Tue Jul 22, 2003 10:54 am
by ::navarre::
cactus wrote:To try and find a solution to your problem, could you explain whether its your code that is more important or the data store ? I ask this because it may be easier to export the data as CSV or TSB (comma/tab separated values) and then import that into mySQL (for example) which can then be handled by PHP in the usual way.

The issue arrises if you intend to move your code over to a production environment where is needs to use ODBC, rather than exporting the new data from mySQL to ODBC.

I'm just waffling!

Regards,
FIRST OF ALL thanks for your patience and for my poor english... :)
(What does it mean .. I'm just waffling..)

I try to explain:
- I MUST use on the code, the php's odbc functions (such as: odbc_connect, odbc_fetch_row,..) because the choice of the firm where I work is - for the server online -, a NT-server and databases are simple .mdb files created with MS Access.

- I'd like to work also at home, only on my Laptop PBG4, and for this reason I installed the PHP 4.3.1, run on Apache web server and
everything 'run' except the code (obviously:)) that point to the .mdb files (until today, I upload the files php on a PC local server, where is set ths DSN on ODBC control panel...)

so... I'd like test all the site locally on my PBG4, with all the php files and the .mdb file.

there is a simple way to make it? :roll:
(Or must I rewrite all the code to connect and make the query to a CSV file, and the rewrite it again before upload it online?)

thx again.

::navarre::

Posted: Tue Jul 22, 2003 11:34 am
by Stoker
Unless Microsoft has ODBC/Jet stuff for Mac-OS I dont think there is much for that, perhaps some commercial stuff somewhere?