All
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require_once ($ruta ?? "./") . "vendor/autoload.php";
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/vendor/autoload.php";
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||
$dotenv->load();
|
||||
use \SeinopSys\PostgresDb;
|
||||
@@ -40,7 +40,7 @@ function query(string $sql, array $params = null, bool $single = true)
|
||||
try {
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute($params);
|
||||
$response = $single ? $stmt->fetch(PDO::FETCH_ASSOC) : $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$response = $single ? $stmt->fetch(PDO::FETCH_ASSOC) : $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
return $response;
|
||||
} catch (PDOException $e) {
|
||||
@@ -60,4 +60,4 @@ function queryAll(string $sql, array $params = null)
|
||||
function toSQLArray(array $array): string
|
||||
{
|
||||
return sprintf("{%s}", implode(", ", $array));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user