943,774 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 357
  • PHP RSS
Mar 30th, 2009
0

Photo pieces compiled in table

Expand Post »
I'm using PHP to piece together photos on my website. I have the pieces in the correct order, but there is white space between each photo. At the moment, the only Css I have is placing the black border around the specified outer edges of the photo - I added this after the white space problem, so I can't think that it affects it.

Could anyone suggest how to correct this issue?

PHP Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  4.  
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  7. <title>Equine Focus</title>
  8. <link rel="stylesheet" type="text/css" href="/style/20090330.css"/>
  9. </head>
  10.  
  11. <body>
  12.  
  13. <?php
  14.  
  15. // Connects to your Database
  16.  
  17. mysql_connect("*****", "*****", "*****") or die(mysql_error());
  18. mysql_select_db("*****")
  19. or die ("Unable to connect to MySQL");
  20.  
  21.  
  22. // mysql
  23.  
  24. $data = mysql_query("SELECT * FROM `photos` WHERE date = '2009-03-21' AND ref ='001'") or die
  25. ("No data available, please contact the site admin describing where you found this error message.");
  26. ?>
  27.  
  28. <table align='center' border='0' padding='0' spacing='0'>
  29.  
  30. <?php
  31. while($info = mysql_fetch_array($data)) {
  32.  
  33. // images
  34.  
  35. $image1='/photos/'.$info['date'].'/'.$info['ref'].$info['piece1'];
  36. $image2='/photos/'.$info['date'].'/'.$info['ref'].$info['piece2'];
  37. $image3='/photos/'.$info['date'].'/'.$info['ref'].$info['piece3'];
  38. $image4='/photos/'.$info['date'].'/'.$info['ref'].$info['piece4'];
  39. $image5='/photos/'.$info['date'].'/'.$info['ref'].$info['piece5'];
  40. $image6='/photos/'.$info['date'].'/'.$info['ref'].$info['piece6'];
  41. $image7='/photos/'.$info['date'].'/'.$info['ref'].$info['piece7'];
  42. $image8='/photos/'.$info['date'].'/'.$info['ref'].$info['piece8'];
  43. $image9='/photos/'.$info['date'].'/'.$info['ref'].$info['piece9'];
  44. $image10='/photos/'.$info['date'].'/'.$info['ref'].$info['piece10'];
  45. $image11='/photos/'.$info['date'].'/'.$info['ref'].$info['piece11'];
  46. $image12='/photos/'.$info['date'].'/'.$info['ref'].$info['piece12'];
  47. $thumb='/photos/'.$info['date'].'/thumbs/'.$info['ref'];
  48.  
  49. // ref
  50.  
  51. $ref = $info['date'].'-'.$info['ref'];
  52.  
  53. // write-up
  54. $text=$info['horse'].' ridden by '.$info['rider'];
  55.  
  56. ?>
  57.  
  58. <tr>
  59. <td><div id='image1'><img src="<?php echo $image1; ?>"</a></div></td>
  60. <td><div id='image2'><img src="<?php echo $image2; ?>"</a></div></td>
  61. <td><div id='image3'><img src="<?php echo $image3; ?>"</a></div></td>
  62. <td><div id='image4'><img src="<?php echo $image4; ?>"</a></div></td>
  63. </tr>
  64.  
  65.  
  66. <tr>
  67. <td><div id='image5'><img src="<?php echo $image5; ?>"</a></div></td>
  68. <td><div id='image6'><img src="<?php echo $image6; ?>"</a></div></td>
  69. <td><div id='image7'><img src="<?php echo $image7; ?>"</a></div></td>
  70. <td><div id='image8'><img src="<?php echo $image8; ?>"</a></div></td>
  71. </tr>
  72.  
  73.  
  74. <tr>
  75. <td><div id='image9'><img src="<?php echo $image9; ?>"</a></div></td>
  76. <td><div id='image10'><img src="<?php echo $image10; ?>"</a></div></td>
  77. <td><div id='image11'><img src="<?php echo $image11; ?>"</a></div></td>
  78. <td><div id='image12'><img src="<?php echo $image12; ?>"</a></div></td>
  79. </tr>
  80.  
  81. <tr><td><span class="refno">Photo Reference: <?php echo $ref; ?></span></td></tr>
  82. <tr><td><span class="infotext"><?php echo $text; ?></td></tr></span>
  83.  
  84. </table>
  85.  
  86. <?php
  87. }
  88. ?>
  89. </table></body></html>

Problem page: http://www.equinefocus.co.uk/photos/2009-03-21/001.php
Last edited by Borderline; Mar 30th, 2009 at 7:46 am. Reason: Edited to include link to problem page
Reputation Points: 11
Solved Threads: 1
Light Poster
Borderline is offline Offline
49 posts
since Apr 2008
Mar 30th, 2009
0

Re: Photo pieces compiled in table

Umm... not sure. You can try to set "cellspacing=0" and "cellpadding=0" in each <td>. And you have an "</a>" in each field without any opening tag.
Reputation Points: 56
Solved Threads: 29
Posting Whiz in Training
sDJh is offline Offline
255 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Alert
Next Thread in PHP Forum Timeline: POST data from one domain to another ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC