Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2004, 09:38 AM
Authorized User
 
Join Date: Jan 2004
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Ashleek007
Default MS ACCESS with PHP

Hi,

im trying to connect an MSaccess database to my site using PHP. Ive created the DSN which is linked to a database called theorytestQns.mdb

I was wondering once ive connected can i use SQL statements in the same way as i would using a mySQL DB?
e.g. select * from blahblah?!

I cant use MySQL because ive been told to use an access DB!

is it similar to using a MYsql db?

any help on this is appreciated,
ASH

__________________
My new web design domain
www.askmultimedia.co.uk
 
Old March 17th, 2004, 02:35 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hi Ashlee,
You might not get any love on this topic, as I don't think anyone on the list uses Access with PHP.

I beleive that Access can function on generic SQL.

What I would suggest, personally, is to use a database wrapper class like PEAR DB. Which *should* keep your options open should you decide (or be forced) to go with a different database backend in the future. Which will save you the headache of searching through thousands of lines of code to make a DB switch. And allow your code to be reused in the future, should you have a project with different needs.

The PEAR DB package is a series of classes used to abstract the database backend. For MS Access this package uses the ODBC (Open Database Connectivity) extension of PHP.

You can get the package from http://pear.php.net.

If you need some assitance with pear, or the DB package itself you can always come back to us or post to the PEAR-GEN mailing list which most of the PEAR authors subscribe to and there's, of course, class documentation available on the PEAR website as well. Beware though, PEAR-GEN is a pretty high traffic list. Don't be surprised if you get up to 75 or more messages in your email box a day from it.

I'd go through all the specifics with you, but it can get a little complicated and I've not had much experience with it.

The PEAR mailing lists can be found here:
http://pear.php.net/support.php

The download page for the DB class:
http://pear.php.net/DB

You can also install this via the PEAR interface from the command line by typing in
>cd C:\PHP
>pear install DB

Where the command line pointer is inside of the PHP install directory. This is the easiest way to go since the PEAR interface will fetch the files from the PEAR server for you and automatically install them to the proper directory. This class comes with PEAR by default also, so it could already be there, if this is the case type in:
>pear upgrade DB

This will install the package to:
C:\PHP\PEAR\DB

Or whatever drive letter PHP is installed on.

The Docs:
http://pear.php.net/manual/en/package.database.php

It may sound complicated, but it actually isn't too bad, especially if you read through all the documentation.

hth!

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::





Similar Threads
Thread Thread Starter Forum Replies Last Post
php and ms access. help? master_paolo PHP Databases 3 March 14th, 2006 01:22 AM
MS Access and PHP tjay PHP Databases 1 October 25th, 2004 04:33 PM
PHP and MS Access darkhalf PHP Databases 2 October 23rd, 2004 04:10 PM
connecting PHP to MS Access pb7 Beginning PHP 5 September 24th, 2004 05:04 PM
connecting PHP to an MS Access database pb7 PHP Databases 1 September 18th, 2003 04:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.