Reset odd() for each result
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@606 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
5ef9322616
commit
1b97f48ea8
|
@ -138,9 +138,9 @@ function get_file($key) {
|
||||||
function odd($s = ' class="odd"') {
|
function odd($s = ' class="odd"') {
|
||||||
static $i = 0;
|
static $i = 0;
|
||||||
if (!$s) { // reset counter
|
if (!$s) { // reset counter
|
||||||
$i = 0;
|
$i = -1;
|
||||||
}
|
}
|
||||||
return (++$i % 2 ? $s : '');
|
return ($i++ % 2 ? $s : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
function select($result) {
|
function select($result) {
|
||||||
|
@ -154,6 +154,7 @@ function select($result) {
|
||||||
$columns = array();
|
$columns = array();
|
||||||
$blobs = array();
|
$blobs = array();
|
||||||
$types = array();
|
$types = array();
|
||||||
|
odd('');
|
||||||
for ($i=0; $row = $result->fetch_row(); $i++) {
|
for ($i=0; $row = $result->fetch_row(); $i++) {
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
echo "<thead><tr>";
|
echo "<thead><tr>";
|
||||||
|
|
Loading…
Reference in a new issue