Jump to content

JimmyLeaman

New Members
  • Posts

    2
  • Joined

  • Last visited

JimmyLeaman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, thanks for your response. Unfortunately I don't have the same degree of knowledge at the moment, could you maybe point me in the right direction? I know I could use something like this which would stop 5 tables being shown, however each image needs to have it's own styling, image size.. etc. <table><tr> <?php while($row=mysqli_fetch_array($result)){ echo ' <td><img src="images/'.$row['id'].'.jpg"></td> '; } ?> </tr><table>
  2. Hey All. I'm currently using the following code to source some information from a Mysql Database. I've limited the results to 6 Values. I'm using the WHILE function to display a table with the results populated in. As you'll see from the attached picture, the WHILE function is causing 5 tables to be created, each with 5 of the same image displayed. How do I go about displaying only 1 table with the 5 different pictures displayed in? <?php $result = mysqli_query($con, "SELECT * FROM photo ORDER BY id DESC LIMIT 6"); while($row = mysqli_fetch_array($result)){ echo '<table> <tr><td class="left"> <a href="photo.php?id='.$row['id'].'"><img src="images/'.$row['id'].'.jpg" height="232" alt=""/></a> </td> <td class="center"> <a href="photo.php?id='.$row['id'].'"><img src="images/'.$row['id'].'.jpg" height="112" alt=""/></a> <a href="photo.php?id='.$row['id'].'"><img src="images/'.$row['id'].'.jpg" height="112" alt=""/></a> </td> <td class="right"> <a href="photo.php?id='.$row['id'].'"><img src="images/'.$row['id'].'.jpg" height="72" alt=""/></a> <a href="photo.php?id='.$row['id'].'"><img src="images/'.$row['id'].'.jpg" height="72" alt=""/></a> <a href="photo.php?id='.$row['id'].'"><img src="images/'.$row['id'].'.jpg" height="72" alt=""/></a> </td></tr></table>'; } ?> Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.