Why use `mysql_pconnect` function?

Why use `mysql_pconnect` function?

asdrenasdren Posts: 20Questions: 0Answers: 0
edited November 2012 in DataTables 1.9
I have noticed that many web hosting companies won't allow the use of `mysql_pconnect` , they want their customers to use `mysql_connect` instead.

What's the benefit of using `mysql_pconnect` instead of the regular `mysql_connect` function?

Replacing the `mysql_pconnect` to `mysql_connect` on my code, will it affect the DataTables plugin negatively in any way.

Or is it just as simple as that, replacing `mysql_pconnect` to `mysql_connect` and everything will work like it should?

Thanks in advance

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    `mysql_pconnect` can be a little faster than `mysql_connect` since it might be able to use an already open connection.

    There is plenty of discussion on it if you google for the two:
    http://stackoverflow.com/questions/247807/mysql-connect-vs-mysql-pconnect for example.

    You can replace the `mysql_pconnect` with `mysql_connect` without changing the fundamental operation of the script.

    Allan
This discussion has been closed.