Introduction
In this article I discuss the two MySQL built-in connection functions "mysql_Connect()" and "mysql_Pconnect()" in PHP. Suppose you want to insert some data into the emp detail table of your database in a PHP application. The first thing that must be done is to create a connection for the table data for the operations and that is done using mysql_connect(), because before you can access data in a database, you must create a connection to the database and after performing all the operations on the database, you should close the connection using the mysql_close() function, but a Pconnection is already open and available for use at any time; the mysql_pconnect() function will not be closed and will persist for future use.
Syntax
|
Mysql_connect('localhost'); |
Example
<?php
//use for connection
{
$con= mysql_connect('localhost');
echo "$con";
}
?>


Comments
Join the conversation! Your thoughts help the community grow.