SQL PHP HTML ASP JavaScript articles and free scripts to download
 
 

PHP MySQL Persistence Connection

Please read mysql_connect to know all details about connecting the mysql database. Here we will see the difference between mysql_connect and mysql_pconnect function. Mysql_pconnect works same as mysql_connect with two differences. Mysql_pconnect function keeps the connection live even the script execution is over. It does not close the connection like mysql_connect case where it closes the connection once the script execution is over. The other difference is it tries to find any existing connection exists and return a identifier if exists.

The main purpose of using mysql_pconnect function is to maintain a persistence connection to the mysql server. Function mysql_close() can't close persisitence connection.

mysql_pconnect ("$servername","$dbuser","$dbpassword");
Related Tutorial
Insert ID
Linking Tables
PHP MySQL data display







Discuss this tutorial at forum

List of SQL Tutorials


Scripts
PHP
JavaScript
SQL Tutorial List
SQL (Home)
mysql_affected_rows mysql_change_user mysql_close mysql_connect mysql_create_db mysql_data_seek mysql_db_name mysql_db_query mysql_drop_db mysql_errno mysql_error mysql_fetch_array mysql_fetch_assoc mysql_fetch_field mysql_fetch_lengths mysql_fetch_row mysql_field_flags mysql_field_len mysql_field_name mysql_field_seek mysql_field_table mysql_field_type mysql_free_result mysql_insert_id mysql_list_dbs mysql_list_fields mysql_list_tables mysql_num_fields mysql_num_rows mysql_pconnect mysql_query mysql_result mysql_select_db mysql_tablename
SQL site Map
Knowledge Management
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.