PHP and Mysql tutorial

Home arrow PHP Tutorials arrow PHP Tutorials arrow PHP and Mysql tutorial
PHP and Mysql tutorial Print E-mail
Contributed by Joe   
Saturday, 08 July 2006

PHP and Mysql overview

PHP has built-in database functions. one of them is the PEAR database functions.PEAR is a framework and distribution system for reusable PHP components which provide the ability to use the same functions to access any supported database.

Process of using PHP and mysql
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.
Querying the Database with PHP Functions
How to connect to a MySQL database with PHP. It's quite simple,when you try connecting to a MySQL database, the MySQL server authenticates you based on your username and password. PHP handles connecting to the database for you and allows you to immediately start performing queries and gathering data.

Create a PHP file which Including Database Login Details
PHP file format
<?php
$db_host='hostname of database server';
$db_database='database name';
$db_username='username';
$db_password='password';
?>

Last Updated ( Saturday, 08 July 2006 )

  home              contact us

 

©2006-2008 DeveloperZone.biz   All rights reserved     powered by Mambo Designed by Siteground