help with a list
Posted: Thu Jun 28, 2012 2:01 pm
hey, hopefully some one can help me here. what im trying to do is to take my 2 working systems that use "while" in php into one line.
the first system is the names from tables, gathers all the table names, the second system takes each <li></li> tag and places a color depending if its even or odd in the list.
i am trying to get the 2 systems to echo on the same line together. thanks!
the first system is the names from tables, gathers all the table names, the second system takes each <li></li> tag and places a color depending if its even or odd in the list.
i am trying to get the 2 systems to echo on the same line together. thanks!
<div id="browser">
<?php
$sql = "SHOW TABLES FROM $dbname";
$result = mysql_query($sql);
if (!$result) {
echo "DB Error, could not list tables\n";
echo 'MySQL Error: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_row($result)) {
echo "Table: {$row[0]}\n";//system 1
}
mysql_free_result($result);
$i=0;
while($i<10){
echo "<li class=".lists($i)."> $i second system<br /> Test </li>";
$i++;
} ?>
</div>
the css part if needed
.even{background-color:#CCC}
.odd{background-color:#FFF}