All PHPLIB does is call the underlying PHP functions to access the database. No reason why PHPLIB should fail if accessing these functions directly works.
Are you seeing anything in the MySQL logs? I suspect your database setup may not be as robust as you think it is.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
pconnect can give a performance boost if your database is able to hold open one connection per web server process *per database/user pair*.
In practice this is generally only possible if you are only running one application on the server and it always accesses one database using the same username.
It fails miserably in a busy vhost environment you finish up with every apache process trying to hold open a connection to every database. You soon hit the max_connections limit in the database and it all comes crashing down.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Some of my pages are with this problem:
MySQL Error: 2013 (Lost connection to MySQL server during query)
I guess its because I am using more than one instance of a DB connection.
But this is crazy and should not happen because sometimes I think its necessary to use 2 or more instances like this:
$db = new memberDB();
$db2 = new memberDB();
$db1->query($q1)
while($db1->next_record())
{ $db2->query($q2);
while($axdb2->next_record())
{ ... }
}
I think the problem is not in the MySql because its used for others applications without DB_Sql class and seems to work quite good.
Another question, whats the disadvantage in use connect() and not pconnect().
Thks all,
I have never heard of this happening before.
All PHPLIB does is call the underlying PHP functions to access the database. No reason why PHPLIB should fail if accessing these functions directly works.
Are you seeing anything in the MySQL logs? I suspect your database setup may not be as robust as you think it is.
pconnect can give a performance boost if your database is able to hold open one connection per web server process *per database/user pair*.
In practice this is generally only possible if you are only running one application on the server and it always accesses one database using the same username.
It fails miserably in a busy vhost environment you finish up with every apache process trying to hold open a connection to every database. You soon hit the max_connections limit in the database and it all comes crashing down.