Display Records in Table

Discussion in 'PHP' started by smallmerchant, May 18, 2010.

  1. #1
    Hello, I would appreciate it if anyone could help me. I am trying to display these records in a table horizontally. Right now I added the table but am not sure how to add the <td> tags so they are put in a row horizontally.

    Thanks in advance.

    
    
    
       echo "<table border='1'>";
       while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
    
       echo "<a href=".$row[1]."><img src='http://www.shrinktheweb.com/xino.php?embed=1&STWAccessKeyId=36c694d&stwsize=sstwUrl=$row[1]'></a><br>";
    
       }
       echo "</table>";
    } else {
        echo "Can't connect to the database!";
    }
    
    
    
    PHP:
     
    smallmerchant, May 18, 2010 IP
  2. Mr. Bin

    Mr. Bin Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What makes you think you can't just print <tr> and <td> as you print other content ? Add them before and at the end of your echo statement and it should work.
     
    Mr. Bin, May 18, 2010 IP
  3. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can also use the implode function to do this
     
    JAY6390, May 18, 2010 IP