Section 9.1. The Process


9.1. The Process

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.

We'll walk through each of these steps for both plain PHP and PEAR functions.

9.1.1. Resources

When connecting to a MySQL database, you will use two new resources. 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. You'll be creating and assigning both resources in this chapter.



Learning PHP and MySQL
Learning PHP and MySQL
ISBN: 0596101104
EAN: 2147483647
Year: N/A
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net