Page 1 of 1

PHP with ODBC and Access

Posted: Sat Feb 21, 2004 2:37 pm
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!

Posted: Sun Feb 22, 2004 7:13 am
by nads1982
can anyone help me to setup my connection I've tried gogling but can't find anythng relevant...
its really important, thnx

Posted: Mon Feb 23, 2004 10:44 am
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
:)

Posted: Mon Feb 23, 2004 11:11 am
by nads1982
thats not what I asked...

Posted: Mon Feb 23, 2004 12:07 pm
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.