I have inv_list.php as a page that shows the basic details of each forklift article: ID#, A small thumbnail, Manufacturer, Model, Year and Price.
The way it works is the following: I have a table that looks like this:
Headers: ID,Img_URL,Manufacturer,Model,Price,Year
Content: ID,Img_URL,Manufacturer,Model,Price,Year
The whole row content has a repeat region function:
<?php do { ?>
<tr bgcolor="$rowcolor">
<td align="left" scope="col" > <a href="inv_detalle.php?siittoID=<?php echo $row_lista_main['mont_ID']; ?>"><?php echo $row_lista_main['mont_ID']; ?></a></td>
<td align="left" scope="col"><img src="<?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['img_url1']; } ?>" height="30" width="30"></td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['marca_name'];} ?></td>
<td scope="col"> </td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['modelo'];} ?></td>
<td scope="col"> </td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['year'];} ?></td>
<td scope="col"> </td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo "$".$row_lista_main['precio'];} ?></td>
</tr><?php } while ($row_lista_main = mysql_fetch_assoc($lista_main));
?>
So that way, you only have as many table rows as data rows in the database.
$rowcolor makes reference to:
<?php
do { $rowcolor = ($rowcolor=="#CCCCCC"){$rowcolor= "#FFFFFF";}else{ $rowolor = "#CCCCCC";}
?>
Unfortunately this returns an error.
Does anybody know how to alternate the bgcolor with every loop of the repeat region function?
Thanks in advance
The way it works is the following: I have a table that looks like this:
Headers: ID,Img_URL,Manufacturer,Model,Price,Year
Content: ID,Img_URL,Manufacturer,Model,Price,Year
The whole row content has a repeat region function:
<?php do { ?>
<tr bgcolor="$rowcolor">
<td align="left" scope="col" > <a href="inv_detalle.php?siittoID=<?php echo $row_lista_main['mont_ID']; ?>"><?php echo $row_lista_main['mont_ID']; ?></a></td>
<td align="left" scope="col"><img src="<?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['img_url1']; } ?>" height="30" width="30"></td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['marca_name'];} ?></td>
<td scope="col"> </td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['modelo'];} ?></td>
<td scope="col"> </td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo $row_lista_main['year'];} ?></td>
<td scope="col"> </td>
<td align="left" scope="col"><?php if ($rows_conteo_prod <= 0) { echo "";} else {echo "$".$row_lista_main['precio'];} ?></td>
</tr><?php } while ($row_lista_main = mysql_fetch_assoc($lista_main));
?>
So that way, you only have as many table rows as data rows in the database.
$rowcolor makes reference to:
<?php
do { $rowcolor = ($rowcolor=="#CCCCCC"){$rowcolor= "#FFFFFF";}else{ $rowolor = "#CCCCCC";}
?>
Unfortunately this returns an error.
Does anybody know how to alternate the bgcolor with every loop of the repeat region function?
Thanks in advance