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 difference between mysql_connect and
mysql_pconnect ? Which one is good in terms of performance ?

Answers were Sorted based on User's Feedback



What is the difference between mysql_connect and mysql_pconnect ? Which one is good in terms of pe..

Answer / brijendra

mysql_connect opens a normal connections to mysql database.
mysql_pconnect opens a persistant connection i.e. if there
is any connection open in the script it will use that
connection not making a new connection each time.
at very high traffic enviornment mysql_connect provides
better performance

Is This Answer Correct ?    38 Yes 3 No

What is the difference between mysql_connect and mysql_pconnect ? Which one is good in terms of pe..

Answer / ranjan goyal

In addition to what Brijendra said, persistanty connections
are limited per server so limited number of people will
have access to the website so infact it will stop high
traffic that implies if we say assuem that our site will
have high traffic then we must not use persistent
connections. Persistent connections should be used only
where we only have limited number of users

Is This Answer Correct ?    21 Yes 3 No

What is the difference between mysql_connect and mysql_pconnect ? Which one is good in terms of pe..

Answer / modi

mysql_pconnect Open a persistent connection to a MySQL server

First, when connecting, the function would first try to find
a (persistent) link that's already open with the same host,
username and password. If one is found, an identifier for it
will be returned instead of opening a new connection...

Second, the connection to the SQL server will not be closed
when the execution of the script ends. Instead, the link
will remain open for future use (mysql_close() will not
close links established by

Is This Answer Correct ?    11 Yes 1 No

What is the difference between mysql_connect and mysql_pconnect ? Which one is good in terms of pe..

Answer / amit

The mysql_pconnect() function opens a persistent MySQL
connection.

This function returns the connection on success, or FALSE
and an error on failure. You can hide the error output by
adding an '@' in front of the function name.

mysql_pconnect() is much like mysql_connect(), but with two
major differences:

•This function will try to find a connection that's already
open, with the same host, username and password. If one is
found, this will be returned instead of opening a new
connection
•The connection will not be closed when the execution of
the script ends (mysql_close() will not close connection
opened by mysql_pconnect()). It will stay open for future
use

Is This Answer Correct ?    7 Yes 2 No

Post New Answer

More PHP Interview Questions

1. Create student database. 2. First page should display the students available in the database. There should be add, edit and delete buttons. 3. There should be option to search students by name, code, date of joining, department or combination of these. 4. Should have an add/edit screen. Add and Edit should be handled in the same page. 5. Delete should ask for confirmation before deleting the actual record. 6. Validation should be done in JavaScript as well as php.

0 Answers   Zonex,


What is overloading in php?

0 Answers  


Write a php script to get the largest key in an array?

0 Answers  


What is basename php?

0 Answers  


What is "print" in php?

0 Answers  


In PHP how many size data can upload by default?

9 Answers   Classic Infotech, PG Software,


I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what is the problem?

0 Answers  


What is the importance of "method" attribute in a html form?

0 Answers  


What is php how it works?

0 Answers  


How to specify argument default values?

0 Answers  


Tell me what does accessing a class via :: means?

0 Answers  


How to call php function from javascript using ajax?

0 Answers  


Categories