<?php require_once "config.php"; //connect to mysql and select db here $kuvahaku = mysql_query("SELECT photopath, 'desc' FROM kuvat") or die (mysql_error()); //"kuvahaku" is finnish and means "get pics" $row_kuvahaku = mysql_fetch_assoc($kuvahaku); $totalRows_kuvahaku = mysql_num_rows($kuvahaku); ?> <table border="1" align="center"> // simple table to show pic thumbnails <?php $i=0; $numberpage=7; ?> <?php do { ?> <?php if($i%$numberpage==0) echo "<tr>";?> <td align="center"> <img src=<?php echo $row_kuvahaku['photopath']; ?> height="100" width="100"><br /><?php echo $row_kuvahaku['desc']; ?></td> //PROBLEM HERE!! <?php $i++; if($i%$numberpage==0) echo "</tr>";?> <?php } while ($row_kuvahaku = mysql_fetch_assoc($kuvahaku)); ?> </table></div> // don't care about this div, this code is just the snippet from my site! <?php mysql_free_result($kuvahaku); ?>
but for the description (desc), something is wrong?
here's image: as you can see there only reads "desc" where should be the descriptions.
every picture is right, every pic is different so no problems from there but this desc thing drives me crazy!!! :D
Comment