Skip to content

Commit

Permalink
Reset odd() for each result
Browse files Browse the repository at this point in the history
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@606 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information
jakubvrana committed May 18, 2009
1 parent 5ef9322 commit 1b97f48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ function get_file($key) {
function odd($s = ' class="odd"') {
static $i = 0;
if (!$s) { // reset counter
$i = 0;
$i = -1;
}
return (++$i % 2 ? $s : '');
return ($i++ % 2 ? $s : '');
}

function select($result) {
Expand All @@ -154,6 +154,7 @@ function select($result) {
$columns = array();
$blobs = array();
$types = array();
odd('');
for ($i=0; $row = $result->fetch_row(); $i++) {
if (!$i) {
echo "<thead><tr>";
Expand Down

0 comments on commit 1b97f48

Please sign in to comment.