beta it republik » News

News

Untitled Document
News

Use PHP to Modify Data from MySQL

In the first part of a three-part series, O’Reilly Media shows you how to use PHP to display and modify data from a MySQL database. This article is excerpted from Chapter nine of O'Reilly publication 'Learning PHP and MySQL', written by Michele Davis and Jon Phillips.

This article shows how to connect to a MySQL server from PHP, learn how to use PHP to access and retrieve stored data, and how to correctly display information to the user.

The Process

For the process, it says the basic steps of performing a query, whether using the MySQL command-line tool or PHP, are the same:

  • Connect to the database
  • Select the database to use
  • Build a SELECT statement
  • Perform the query
  • Display the results


The article walks through each of these steps for both plain PHP and PEAR functions.

Resources

When connecting to a MySQL database, two new resources are used. The first is the link identifier that holds all of the information necessary to connect to the database for an active connection. The other resource is the results resource. It contains all information required to retrieve results from an active database query's result set.

The rest of the article is explained under the following heads:


Comments



Name:




Comment:

Captcha Verification !
captcha_image