Results 1 to 2 of 2

Thread: Array into tables with addidtions

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    156

    Array into tables with addidtions

    I have an multidimentional array that i have placed into a table...

    PHP Code:
                     $count_echo 0
                     
    echo '<tr>'
              
    while($row mysql_fetch_array($result)){
                     
    $count_echo++;
                     echo 
    "<td>$row[1]</td>";

           if (
    $count_echo 3) {
             echo 
    "</tr>";
             echo 
    "<tr>";
             
    $count_echo 0
    it all works but...??! How would you I add something in the first cell and move everything along a cell?

    colspan="x"

    lets me place it on top but not inside

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: Array into tables with addidtions

    I'm not really 100&#37; sure what you want to do, but this will add a cell before the first cell and move every previous onto the next.
    PHP Code:
    <?php
      $c 
    0;
      while(
    $row mysql_fetch_array($result)){
        
    $c++;

        if(
    $c == 1){
          
    //this is your first cell.
        
    }else{
          
    //this is any cell but the first cell; do whatever you would do normally
        
    }
        if(
    $c 4//changed 3 to 4 to include an extra cell.
          
    $c 0;
      }
    ?>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width