We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4180b0 commit 1753f3aCopy full SHA for 1753f3a
1 file changed
WebFiori/Database/MySql/MySQLConnection.php
@@ -82,7 +82,15 @@ public function close(): void {
82
* @return bool True if the connection is active.
83
*/
84
public function isAlive(): bool {
85
- return $this->link !== null && @$this->link->ping();
+ if ($this->link === null) {
86
+ return false;
87
+ }
88
+
89
+ try {
90
+ return @$this->link->query('SELECT 1') !== false;
91
+ } catch (\Exception $e) {
92
93
94
}
95
96
public function beginTransaction(?string $name = null) {
0 commit comments