Hi again mate,
First we'll sort out the table then we'll stick in the title....
i think i spoted the error with my code....
try this...
i've moved the increment before the if statement.
First we'll sort out the table then we'll stick in the title....
i think i spoted the error with my code....
try this...
Code:
<?php $errmsg = ""; if (! @mysql_connect("localhost","root","")) { $errmsg = "Cannot connect to database"; } @mysql_select_db("upload"); $strSQL = "select * from pix"; $rsPix = mysql_query($strSQL); $numRows = mysql_numrows($rsPix); $i = 0; ?> <table> <tr> <?php while($i < $numRows){ ?> <td> <img src="pix.php?pixID=<?php echo mysql_result($rsPix,$i,"pixID"); ?>"/> </td> <?php $i++; if ($i%3 == 0){ ?> </tr><tr> <?php } ?> <?php } ?> <?php if ($numRows%3 > 0){ ?> <td colspan="<?php echo $numRows%3; ?>"> </td> <?php } ?> </tr> </table>
Comment