RE: PHP3 and Access Databases
| From: | Nold, Mark | Date: | Thu, 09 Nov 2000 04:52:58 +0000 |
| Subject: | RE: PHP3 and Access Databases | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-24426@lists.php.net to get a copy of this message | ||
----------------------------------------------------------------------------
-----------------
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
postmaster@normandy.com.au and delete the email document without making a
copy.
----------------------------------------------------------------------------
-----------------
Set up an ODBC System DSN so you can access your .MDB from and ODBC enabled
app like (MS Excel or even PHP :) the use the ODBC functions from the manual
to connect and execute SQL's in your .MDB.
The things to remember are:
1. Use a System DSN for ODBC
2. The DB should be on the same PC as your PHP install (because of the way
MS Access works not PHP)
3. I wouldnt go ahead and build anything huge in MS Access as its really
only good for a Recipee database ;) A lot of SQL you write will not be
transferable to another DB if you decide to change the back end. (I think
that not even MS SQL accepts MS Access style SQL)
4. Investigate the various DB Abstractions layers (PHPlib, PEAR->DB and
Metabase) as they are very worthwhile for projects that you may wich to
change the DB later.
5. Use the MS Access query builder (which is nice) to build your SQL and
simply plug your variables into it;
$var1 = "Perth";
$var2 = "Mark";
$sql = "
SELECT
*
FROM
mytable
WHERE
myfield = '$var1' and
anotherfield = '$var2'
";
Then go ahead and do all the ODBC calls to run the query and return some
results.
But essentially accessing Access from PHP is similiar to any other DB,
especially the ODBC connected ones. (except for point 2 above)
Hope this helps.
Also look at the php-db lists as you might find some more info there.
mn
Mark Nold
markn@enspace.com <mailto:markn@enspace.com>
Senior Consultant
Change is inevitable, except from vending machines.
-----Original Message-----
From: Jeff Demel [mailto:jdlists@iglue.com]
Sent: Wednesday, November 08, 2000 7:00 AM
To: php-general@lists.php.net
Subject: PHP3 and Access Databases
Does anyone have experience using PHP3 with an Access database? Any
thoughts/experiences on using it would be great. I can't seem to find
anything worthwhile on the subject.
-Jeff