Deprecated: mysql_pconnect ():

I get an error at runtime php, which, in my opinion, is associated with a newer version of php 5.5.

Obsolete: mysql_pconnect(): mysql extension is out of date and will be removed in the future: instead use mysqli or PDO in /public_html/mydomain.com/connx.php line 7
April 3, 2014
check

The internal code looks like this

http://justpaste.it/eyk2

So I thought that changing mysqlto mysqlimight solve the problem:

$conn = mysqli_pconnect($hostname_conn, $username_conn, $password_conn) or trigger_error("Server Down"); 

And instead, I get this error ... so I think that was the wrong way to do it :)

Fatal error: calling an undefined function mysqli_pconnect()

Anyway, can I solve this problem? The code was built a long time ago, and now I can not contact it: x

** ** mysqli_connect, php... ... , ?

mysql_select_db($database_conn);
mysql_query("SET NAMES UTF8");
+8
3

mysql_pconnect:

:

mysqli_connect() p: host

mysqli_connect, not mysqli_pconnect ,

+11

"mysqli_pconnect", mysqli_connect(), p: .

, , php :

if (!function_exists("mysql_pconnect")){
    function mysql_pconnect($host, $username, $password){
        return mysqli_connect("p:".$host, $username, $password);
    }
}

UPDATE: pconnects , mysql_pconnect mysql_connect .

+4

No mysqli_pconnect(), but you can use persistent connections using mysqli_connect()as described in the manual by simply adding p:the hostname to the beginning.

Quote from the manual:

Prepending host by p: opens a persistent connection.
0
source

Source: https://habr.com/ru/post/1534801/


All Articles