This tutorial explains how to use several basic MySQL database functions in PHP. Main topics include: Connecting to a mySQL database using PHP, SHOW available tables, Using telnet to CREATE tables, How to INSERT, QUERY, UPDATE, and DELETE rows in a table, How to ALTER a table, Commenting Your mySQL Tables, and Creating mySQL tables.
When interacting with a database, functions are called that are common to every transaction; functions to establish a connection, execute the query and then close the connection. This article shows how to create functions that will eliminate this redundancy. The tutorial uses MySQL as the database, but the database layer is irrelevant. These functions can be adapted to use other databases.
The MySQL database is one of the most popular among PHP developers, and there are numerous well-documented PHP functions you can use in conjunction with your MySQL databases. In this tutorial, you will learn how to make a simple connection to MySQL using just a few of these functions.
Like MySQL, the PostgreSQL database is quite popular among PHP developers. Understandably, there are numerous well-documented PHP functions you can use in conjunction with PostgreSQL. Here you will find how to make a simple connection and select some data using just a few of these functions.
PHP includes functions for Open Database Connectivity (ODBC), which is useful if, for example, you want to connect to a Microsoft Access data source on Windows NT. An increasing number of PHP developers are using the ODBC functions to connect to databases; to that end, the ODBC functions are numerous and well-documented in the PHP Manual. This tutorial presents how to make simple ODBC connections using just a few of these functions.
PHP provides built in functions to access just about every database that exists, including Oracle. This 8-page tutorial illustrates how to use these built in functions to communicate with an Oracle database.