Filter on search page

It also works with jquery now
This commit is contained in:
Lars van Hijfte
2017-01-26 13:53:59 +01:00
parent 7b7f0b2c64
commit 33a640329b
14 changed files with 248 additions and 133 deletions

View File

@@ -316,17 +316,16 @@ function selectRandomNotFriendUser($userID) {
return $stmt->fetch();
}
function searchSomeUsers($n, $m, $search)
{
function searchSomeUsers($n, $m, $search) {
$stmt = $GLOBALS["db"]->prepare("
SELECT
`userID`,
`username`,
IFNULL(
`profilepicture`,
'../img/notbad.jpg'
'../img/avatar-standard.png'
) AS profilepicture,
`fname`,
`lname`
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 15) as `fullname`
FROM
`user`
WHERE
@@ -345,8 +344,10 @@ function searchSomeUsers($n, $m, $search)
$stmt->bindParam(':keyword', $search);
$stmt->bindParam(':n', $n, PDO::PARAM_INT);
$stmt->bindParam(':m', $m, PDO::PARAM_INT);
$stmt->execute();
return $stmt;
return json_encode($stmt->fetchAll());
}
function countSomeUsers($search) {