Wednesday, February 22, 2012

Connect to a database

August 10, 2010 by tutorials · Leave a Comment 

Before you can access data in a database, you must create a connection to the database.
In PHP, this is done with the mysql_connect() function.
Syntax:
mysql_connect(servername,username,password);

Parameter
Description

servername
Optional. Specifies the server to connect to. Default value is “localhost:3306″

username
Optional. Specifies the username to log in with. Default value is the name of the user that owns the server [...]

MySQL

August 10, 2010 by tutorials · Leave a Comment 

MySQL is the most popular open-source database system.
The data in MySQL is stored in database objects called tables.
A table is a collections of related data entries and it consists of columns and rows.
Databases are useful when storing information categorically. A company may have a database with the following tables: “Employees”, “Products”, “Customers” [...]