Sunday, December 2, 2012

break same value in 2 td in php with while loop

<div style="clear:both;"> </div>
<style type="text/css">
div.color1 {
  border-width:3px;
  border-style:solid;
  border-color:#ff9900;
  margin:25px 5px 5px 5px;
  padding:20px;
line-height:20px;
  }
</style>
<div class="color1">
<table width="100%" cellspacing="0" cellpadding="5" border="0" summary="Subcategories">
      
      
        <?php
    $sql = mysql_query("SELECT * FROM jml_makers ") or die(mysql_error());
    $total_rows = mysql_num_rows($sql);
    $i = 1;
    while ( $result = mysql_fetch_assoc($sql) ) {   ?>

        <?php if($i%2 == '1') { ?>
            <tr>  
                    <td class="navigation"><a href="index.php?option=com_jumi&fileid=12&Itemid=53&maker=<?php echo $result["maker_name"]; ?>"><?php echo $result["maker_name"]; ?></a></td>
        <?php } elseif($i%2 == '0') { ?>
                    <td class="navigation"><a href="index.php?option=com_jumi&fileid=12&Itemid=53&maker=<?php echo $result["maker_name"]; ?>"><?php echo $result["maker_name"];  ?></a></td>
            </tr>                     
        <?php } ?>

    <?php  $i++; } ?>
      
      
      
      
     
      
      
        </table>
</div>

No comments:

Post a Comment

Thank you for your Comment....

Popular Posts