Commit 84d21e6f authored by canyonknight's avatar canyonknight Committed by Lukas Fleischer
Browse files

pkg_search_results.php: Pull out DB code



* Move DB code from pkg_search_results.php to already existing function
in pkgfuncs.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 71f2efd7
......@@ -602,6 +602,11 @@ function pkg_search_page($SID="", $dbh=NULL) {
}
include('pkg_search_form.php');
while ($row = mysql_fetch_assoc($result)) {
$searchresults[] = $row;
}
include('pkg_search_results.php');
return;
......
......@@ -46,9 +46,8 @@ if (!$result): ?>
</thead>
<tbody>
<?php for ($i = 0; $row = mysql_fetch_assoc($result); $i++): ?>
<tr class="<?php echo ($i % 2 == 0) ? 'odd' : 'even' ?>">
<?php while (list($indx, $row) = each($searchresults)): ?>
<tr class="<?php echo ($indx % 2 == 0) ? 'odd' : 'even' ?>">
<?php if ($SID): ?>
<td><input type="checkbox" name="IDs[<?php echo $row["ID"] ?>]" value="1" /></td>
<?php endif; ?>
......@@ -76,7 +75,7 @@ if (!$result): ?>
<?php endif; ?>
</td>
</tr>
<?php endfor; ?>
<?php endwhile; ?>
</tbody>
</table>
......
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