mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
replace "p" with higher level database functions
This commit is contained in:
parent
948450c24b
commit
27b9da3df5
8 changed files with 30 additions and 71 deletions
|
@ -43,6 +43,8 @@ function msearch_post(App $a)
|
|||
|
||||
$total = 0;
|
||||
|
||||
$condition = ["`net-publish` AND MATCH(`pub_keywords`) AGAINST (?)", $search];
|
||||
$total = DBA::count('owner-view', $condition);
|
||||
$count_stmt = DBA::p(
|
||||
"SELECT COUNT(*) AS `total`
|
||||
FROM `profile`
|
||||
|
@ -58,18 +60,7 @@ function msearch_post(App $a)
|
|||
|
||||
DBA::close($count_stmt);
|
||||
|
||||
$search_stmt = DBA::p(
|
||||
"SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid`
|
||||
FROM `user`
|
||||
JOIN `profile` ON `user`.`uid` = `profile`.`uid`
|
||||
WHERE `profile`.`net-publish`
|
||||
AND MATCH(`pub_keywords`) AGAINST (?)
|
||||
LIMIT ?, ?",
|
||||
$search,
|
||||
$startrec,
|
||||
$perpage
|
||||
);
|
||||
|
||||
$search_stmt = DBA::select('owner-view', ['pub_keywords', 'name', 'nickname', 'uid'], $condition, ['limit' => [$startrec, $perpage]]);
|
||||
while ($search_result = DBA::fetch($search_stmt)) {
|
||||
$results[] = [
|
||||
'name' => $search_result['name'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue