Layout of mySQL quary (again!)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi there,

I have the following code:

$side1 = '#EFEFEF';
$side2 = '#DDDDDD';
$sideoffset = 0;

echo "<table>";
  $column = 0;
    while ($myrow = mysql_fetch_array($result2)) {
          $TDcolor = ($sideoffset++ % 2) ? $side1 : $side2;
        if (!$column) echo "<tr >";
            echo "<td bgcolor=\"$TDcolor\">",$myrow["last"],"</td>";
        if ($column) echo "</tr>";
      $column = !$column;
  if ($column) echo "<td></td></tr>";
echo "</table>";

This really works great, but my next problem is that collumns on
the left side, need another <td>$var</td> on their left, and
the ones on the right need it on the right, so the output would
look like:

 _ _____ _____ _

I hope this is clear enough, and that anyone can help me...

Greetings knoakske

Re: Layout of mySQL quary (again!)

knoak wrote:
Quoted text here. Click to load it

echo "<td bgcolor=\"$TDcolor\">",$myrow["last"],"</td>";

echo "<td></td><td>$var</td><td>",$myrow["last"],"</td><td></td>";

and  change:
echo "<table>";

echo "<table bgcolor=\"$TDcolor\">
and of course you will have to move the statement where you
define $TDcolor.

Site Timeline