Skip to content

Commit be0e85c

Browse files
committed
:octocat: mysqli driver port fix
1 parent 2481dfc commit be0e85c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Drivers/MySQLiDrv.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function connect():DriverInterface{
5353
$this->options->username,
5454
$this->options->password,
5555
$this->options->database,
56-
(int)$this->options->port,
56+
!empty($this->options->port) ? (int)$this->options->port : null,
5757
$this->options->socket
5858
);
5959

@@ -133,6 +133,8 @@ protected function prepared_query(string $sql, array $values = null, string $ind
133133
$result = $stmt->result_metadata();
134134

135135
if(is_bool($result)){
136+
// https://www.php.net/manual/mysqli-stmt.result-metadata.php#97338
137+
// the query did not produce a result, everything ok.
136138
return true;
137139
}
138140

0 commit comments

Comments
 (0)