Browse Source

implement like method

PHP-GTK3
yggverse 4 months ago
parent
commit
3edddbe8d0
  1. 26
      src/Model/Database/Auth.php

26
src/Model/Database/Auth.php

@ -126,4 +126,30 @@ class Auth
return $query->fetchAll(); return $query->fetchAll();
} }
public function like(
string $request = '',
int $start = 0,
int $limit = 1000
): array
{
$query = $this->_connection->prepare(
sprintf(
'SELECT * FROM `auth`
WHERE `request` LIKE :request
ORDER BY `request` ASC
LIMIT %d,%d',
$start,
$limit
)
);
$query->execute(
[
':request' => $request
]
);
return $query->fetchAll();
}
} }
Loading…
Cancel
Save