Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the advantge and disadvantage of mysql_connet() and
mysql_pconnect() ? in which condition will you use
mysql_connect() and mysql_pconnect().

Answer Posted / praveen

mysql_pconnect() will maintain a persistent connection to
the database. whenever your script calls the connect to
database function, it first searches already existing
connections to the database and if exists it will use the
same connection to connect to the database, if not it will
open a new connection to the database. ie. Connection is
Persistent

where as mysql_connect() function will establish a new
connection whenever a connection to database needed, and
after executing the script, this function disconnects the
connection. ie. connection is not a persistent one.

mysql_pconnect() function is used where your site has a
Heavy Traffic and where as mysql_connect() function is used
when there is moderate/less traffic to your site.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two types of variables?

919


What is session data?

906


Which function is used to read a file removing the html and php tags in it upwork?

873


What is php regular expression?

924


Declare a new variable in php equal to the number 3;

882


Which parts of php are case sensitive?

862


How to calculate the difference between two dates using php?

986


Explain what is the difference between for and foreach?

973


Tools used for drawing er diagrams?

945


What does addslashes do in php?

974


How can I learn php fast?

1004


What are the three parts of an http request?

921


How can you increase the maximum execution time of a script in php?

897


Differentiate between php5 and php7?

1026


What is the use of mysql_real_escape_string() function?

879