PdoMysql.php 655 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * MINZ - Copyright 2011 Marien Fressinaud
  4. * Sous licence AGPL3 <http://www.gnu.org/licenses/>
  5. */
  6. class Minz_PdoMysql extends Minz_Pdo {
  7. public function __construct(string $dsn, $username = null, $passwd = null, $options = null) {
  8. parent::__construct($dsn, $username, $passwd, $options);
  9. $this->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
  10. }
  11. public function dbType(): string {
  12. return 'mysql';
  13. }
  14. // PHP8+: PDO::lastInsertId(?string $name = null): string|false
  15. #[\ReturnTypeWillChange]
  16. public function lastInsertId($name = null) {
  17. return parent::lastInsertId(); //We discard the name, only used by PostgreSQL
  18. }
  19. }