Using MYSQLI_CLIENT_COMPRESS for speed with mysqli_real_connect
#1
Lightbulb 
This may vary on your use case. In my case I have a separate database server and wanted to compress data to make it more efficient to send over.

Requires edit to inc\db_mysqli.php
Find
if($port)
{
$this->$link = @$connect_function($persist.$hostname, $single_connection['username'], $single_connection['password'], "", $port);
}
else
{
$this->$link = @$connect_function($persist.$single_connection['hostname'], $single_connection['username'], $single_connection['password']);
}


Change to
$this->$link = mysqli_init();

if($port)
{
mysqli_real_connect($this->$link, $persist.$hostname, $single_connection['username'], $single_connection['password'], $port,0,MYSQLI_CLIENT_COMPRESS);
}
else
{
mysqli_real_connect($this->$link, $persist.$single_connection['hostname'], $single_connection['username'], $single_connection['password'], '',0,MYSQLI_CLIENT_COMPRESS);
}

Reply


Messages In This Thread
Using MYSQLI_CLIENT_COMPRESS for speed with mysqli_real_connect - by vbgamer45 - 2020-07-23, 08:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)