what is the best function that can be used to connect to
mysql database and in what cases that we can use below
functions ?
1. mysql_connect()
2. mysql_pconnect()
please give your answer with all pros and cons
Answer / p.sivasankar
1>>mysql_connect() — Open a connection to a MySQL Server
Description:
resource mysql_connect ([ string $server [, string
$username [, string $password [, bool $new_link [, int
$client_flags ]]]]] )
Opens or reuses a connection to a MySQL server
2>>mysql_pconnect — Open a persistent connection to a MySQL
server
Description:
resource mysql_pconnect ([ string $server [, string
$username [, string $password [, int $client_flags ]]]] )
Establishes a persistent connection to a MySQL server.
mysql_pconnect() acts very much like mysql_connect() with
two major differences.
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 mysql_pconnect()).
This type of link is therefore called 'persistent'
| Is This Answer Correct ? | 7 Yes | 0 No |
What is ci in php?
What is Type hinting in PHP?
How to download file in php?
Is php class name case sensitive?
What is csrf token and why it is required?
What is == and === in php?
Explain about Type Juggling in PHP?
how to use http headers inside php? Write the statement through which it can be added?
How can we register the variables into a Session?
7 Answers HCL, Star Computers, Trikon Networks,
hai, friend i srinu i had completed my graduation in 2004. now i am fineshed PHP course .may i get any oppartunity on php progr pls sugg me . thank u
Which is better python or php?
Who is the father of PHP and explain the changes in PHP versions?
2 Answers Rushmore Consultancy,