Professional Web Applications Themes

newbie php problem - PHP Development

I am going crazy trying to find out whats wrong with the below. It shows all the right information but not in the right order. What I want is for every 4th cell/record for there to be a new row started in the table. Help please. Matt <?php $count = 0 ;?> <?php do {;?> <?php $count++ ;?> <td bordercolor="#CCCCCC"> <a href="images.php?$row_Recordset2%5B%27ImageID%27%5 D"><img src="images/gallery/thumbs/tn_<?php echo $row_Recordset2['Imagename']; ?>" alt="" border="0"></a> <br> <font size="2"><?php echo $row_Recordset2['ImageTitle']; ?></font></td> <?php if ($count == 4) echo "</td><td>" ?> <br> <?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));?> </tr></table>...

  1. #1

    Default newbie php problem

    I am going crazy trying to find out whats wrong with the below. It shows all
    the right information but not in the right order.
    What I want is for every 4th cell/record for there to be a new row started
    in the table.

    Help please. Matt

    <?php $count = 0 ;?>
    <?php do {;?>
    <?php $count++ ;?>
    <td bordercolor="#CCCCCC"> <a
    href="images.php?$row_Recordset2%5B%27ImageID%27%5 D"><img
    src="images/gallery/thumbs/tn_<?php echo $row_Recordset2['Imagename']; ?>"
    alt="" border="0"></a>
    <br>
    <font size="2"><?php echo
    $row_Recordset2['ImageTitle']; ?></font></td>

    <?php if ($count == 4)
    echo "</td><td>" ?>
    <br>
    <?php } while ($row_Recordset2 =
    mysql_fetch_assoc($Recordset2));?>
    </tr></table>


    Matt Guest

  2. #2

    Default Re: newbie php problem

    You're going crazy because you haven't been looking at any code samples to
    show you how to use php. You're basic problem is that you are embedding
    php into an html page. Instead, you should be using php to GENERATE an
    html page.

    <?php
    print "<TABLE>";
    print "<TR>";
    for ($intLoopCtr = 1; $intLoopCtr <=4; $intLoopCtr++){
    print "<TD>";
    print "<A HREF=images/php/".$row_Recordset2['ImageName'].">";
    print "blahblahblah".$row_Recordset2['ImageID'];
    print "</A>";
    print "</TD>";
    }
    print "</TR>";
    print "</TABLE>";

    ?>

    TJ
    tj Guest

Similar Threads

  1. help newbie with reading XML problem
    By hsin in forum Macromedia Flash
    Replies: 2
    Last Post: January 28th, 11:51 PM
  2. newbie problem
    By Karzy in forum ASP.NET Building Controls
    Replies: 5
    Last Post: June 26th, 04:31 AM
  3. newbie has a problem...please help me out
    By Timon in forum FileMaker
    Replies: 1
    Last Post: September 17th, 11:55 AM
  4. Please help with newbie problem
    By Mark F. in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: August 15th, 10:14 PM
  5. Newbie IIS6/ASP.net problem
    By Michael Kelty in forum ASP.NET General
    Replies: 6
    Last Post: July 14th, 05:54 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139