Skip to content

Commit

Permalink
Port auth is now supported
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcrypster authored Aug 3, 2022
1 parent c61e87a commit cba234c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mysqly.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function exec($sql, $bind = []) {
if ( !self::$auth ) {
self::$auth = @include self::$auth_file;
}
self::$db = new PDO('mysql:host=' . (self::$auth['host'] ?: 'localhost') . ';dbname=' . self::$auth['db'], self::$auth['user'], self::$auth['pwd']);
self::$db = new PDO('mysql:host=' . (isset(self::$auth['host']) ?: '127.0.0.1') . ';port=' . (isset(self::$auth['port']) ?: '3306') . (self::$auth['db'] ? ';dbname=' . self::$auth['db'] : ''), self::$auth['user'], self::$auth['pwd']);
self::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}

Expand Down

0 comments on commit cba234c

Please sign in to comment.