PHP with ODBC and Access

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
nads1982
Forum Newbie
Posts: 9
Joined: Sat Feb 21, 2004 2:37 pm

PHP with ODBC and Access

Post by nads1982 »

I would like to connect to an access database using ODBC and PHP.
However, I am a beginner and am unsure how to start.. I have set up the ODBC driver but this is merely on my computer, not on the server... how do I make the connection?? help!
nads1982
Forum Newbie
Posts: 9
Joined: Sat Feb 21, 2004 2:37 pm

Post by nads1982 »

can anyone help me to setup my connection I've tried gogling but can't find anythng relevant...
its really important, thnx
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

Mhh well to connect to a Access DB

Code: Select all

$connect = odbc_connect("db_name", "user", "password") or die("Connection failed");
//here you make the query you want : for exemple i m Selecting (ALL) my field from my table
$query = "SELECT * FROM my_table";
$queryexe = odbc_do($connect, $query);
..that s it.. then you can do whatever you want
Here you can have all the info (left column) about odbc commands
:)
nads1982
Forum Newbie
Posts: 9
Joined: Sat Feb 21, 2004 2:37 pm

Post by nads1982 »

thats not what I asked...
User avatar
Dr Evil
Forum Contributor
Posts: 184
Joined: Wed Jan 14, 2004 9:56 am
Location: Switzerland

Post by Dr Evil »

nads1982 wrote:thats not what I asked...
Well instead of being blunt, just explain in details what you need. Draco might be able to help you then.

You want to know if you can connect with the Access interface to the MySQL database? If that's it, the ODBC drivers will work fine locally. For a distant server your provider must accept persistant connections and give you the address of the server.
Post Reply