Using ODBC with PHP

Monday, September 14, 2009 | |

Using ODBC with PHP ODBC is one of Microsoft's earliest technologies for connecting to databases. It is very popular and widely used. This article describes how to setup and use ODBC from a PHP perspective.

Also see DSN-less connections with PHP.

What is ODBC?

Open DataBase Connectivity is an Application Programming Interface (API) that allows a programmer to abstract a program from a database. When writing code to interact with a database, you have to add code that talks to a particular database using a proprietary API. If you want your program to talk to an Access, FoxPro and Oracle databases you have to code your program with three different database API's. This can be quite the daunting task causing much grief. Now, enter ODBC...

When programming to interact with ODBC you only need to use the ODBC API (a combination of ODBC extension function calls and the SQL language) to talk to different database products. The ODBC Manager will figure out how to contend with the type of database you are targeting. Regardless of the database type you are using, all of your calls will be to the ODBC API. All that you need to do is have installed an ODBC driver that is specific to the type of database you will be using.

Creating A ODBC Data Source Name (DSN)

After you have ensured that the ODBC driver for your database is installed, you normally need to create a Data Source Name (DSN), which contains all the connection details required to login (accept maybe id and password).

Walkthrough: How to Setup a DSN. A pictorial step-by-step guide. The next button is hidden on the bottom-right. Sorry but we Windows programmers are not user interface experts ;-)

Continue reading here

2 comments:

Sismadi said...

great posting... wanna link axchange bro..we have the same hobbies.

please check ur link on my blog http://allakom.blogspot.com

don't forget leave comment for me.

IMAM MAKSUM said...

kunjungan,di hara raya penuh berkah bgattttt......
oya mampir2 ksini donk smbil silaturrihim,disini rame lho......

Post a Comment

 

Privacy Policy for programmer-brienne.blogspot.com

If you require any more information or have any questions about our privacy policy, please feel free to contact us by email at denric25@yahoo.com.

At programmer-brienne.blogspot.com, the privacy of our visitors is of extreme importance to us. This privacy policy document outlines the types of personal information is received and collected by programmer-brienne.blogspot.com and how it is used.

Log Files Like many other Web sites, programmer-brienne.blogspot.com makes use of log files. The information inside the log files includes internet protocol ( IP ) addresses, type of browser, Internet Service Provider ( ISP ), date/time stamp, referring/exit pages, and number of clicks to analyze trends, administer the site, track user’s movement around the site, and gather demographic information. IP addresses, and other such information are not linked to any information that is personally identifiable.

Cookies and Web Beacons programmer-brienne.blogspot.com does not use cookies.

DoubleClick DART Cookie

.:: Google, as a third party vendor, uses cookies to serve ads on programmer-brienne.blogspot.com. .:: Google's use of the DART cookie enables it to serve ads to your users based on their visit to programmer-brienne.blogspot.com and other sites on the Internet. .:: Users may opt out of the use of the DART cookie by visiting the Google ad and content network privacy policy at the following URL - http://www.google.com/privacy_ads.html

Some of our advertising partners may use cookies and web beacons on our site. Our advertising partners include ....... Google Adsense

These third-party ad servers or ad networks use technology to the advertisements and links that appear on programmer-brienne.blogspot.com send directly to your browsers. They automatically receive your IP address when this occurs. Other technologies ( such as cookies, JavaScript, or Web Beacons ) may also be used by the third-party ad networks to measure the effectiveness of their advertisements and / or to personalize the advertising content that you see.

programmer-brienne.blogspot.com has no access to or control over these cookies that are used by third-party advertisers.

You should consult the respective privacy policies of these third-party ad servers for more detailed information on their practices as well as for instructions about how to opt-out of certain practices. programmer-brienne.blogspot.com's privacy policy does not apply to, and we cannot control the activities of, such other advertisers or web sites.

If you wish to disable cookies, you may do so through your individual browser options. More detailed information about cookie management with specific web browsers can be found at the browsers' respective websites.

Nunag Free and Premium Web Directory