Commit 71f2efd7 authored by canyonknight's avatar canyonknight Committed by Lukas Fleischer
Browse files

account_search_results.php: Pull out DB code



* Move DB code from account_search_results.php to already existing function
in acctfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface
Signed-off-by: default avatarcanyonknight <canyonknight@gmail.com>
Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent c2b65f2b
......@@ -323,6 +323,12 @@ function search_results_page($UTYPE,$O=0,$SB="",$U="",$T="",
$dbh = db_connect();
$result = db_query($q, $dbh);
$num_rows = mysql_num_rows($result);
while ($row = mysql_fetch_assoc($result)) {
$userinfo[] = $row;
}
include("account_search_results.php");
return;
}
......
......@@ -2,7 +2,6 @@
if (!$result):
print __("No results matched your search criteria.");
else:
$num_rows = mysql_num_rows($result);
if ($num_rows):
?>
<table class="results">
......@@ -20,7 +19,7 @@ else:
</thead>
<?php
$i = 0;
while ($row = mysql_fetch_assoc($result)):
while (list($indx, $row) = each($userinfo)):
if ($i % 2):
$c = "even";
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment