PHP and MySQL
Querying Web DatabasesPHP and MySQL - Querying Web Databases
Querying Web Databases
Connecting to a MySQL Database
Opening and Using a Database Connection
Essential Functions for Accessing MySQL with PHP
More MySQL Functions in PHP
Frequently used functions
Other functions
Functions to avoid
Error Handling of MySQL Database Functions
Formatting Results
Using Include Files in Practice
Case Study: The Front-Page Panel
Step 1: Producing Visually Appealing Tables
Step 2: Adding Varieties to the Panel
Adding a second or subsequent query
Adding calculations to the result presentation
Step 3: Finishing the Panel
Fixing the queries
Interacting with Other DBMSs Using PHP
Microsoft SQL Server
Open DataBase Connectivity (ODBC)
Oracle 7 and 8 Through the OCI8 Interface
PostgreSQL
We introduce the following techniques in this tutorial:
- Using the five-step web database querying approach to develop database-driven queries
- Coding a simple solution to produce HTML <pre> pre formatted text
- Using the MySQL library functions for querying databases
- Handling MySQL DBMS errors
- Producing formatted output with the HTML <table> environment
- Using include files to modularize database code
- Adding multiple queries to a script and consolidating the results into one HTML presentation environment
- Performing simple calculations on database data
- Developing basic database-driven scripts incrementally and producing modular code encapsulated in functions