Piotr Labudda 8 anni fa
parent
commit
daeaa1ae80
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      SE/se-lib/Core/Pdo.php

+ 6 - 0
SE/se-lib/Core/Pdo.php

@@ -433,6 +433,12 @@ EOF_STRUCT_MYSQL;
 		return $sth->fetchColumn();
 	}
 
+	public function fetchValuesList($sql, $values = []) { // for sql like `select ID from ...` @returns array of ID
+		return array_map(function ($row) {
+			return reset($row);
+		}, $this->fetchAll($sql, $values));
+	}
+
 	public function fetchFirst($sql, $values = []) { // fetch only first row
 		$sth = $this->prepare($sql);
 		if (!empty($values)) {