Jump to content

displaying images from database horizontally


plugnz

Recommended Posts

Hi there, I am building a film scouts website and need to display a lot of images on one page selected via a database. Curently the images are listed vertically on the page but I want them horizontally listed.

 

the code is something like this

$query1 = "SELECT category_id, category_name " .
               "FROM cms_categories " .
               "ORDER BY category_name";
		   
      $results1 = mysql_query($query1,$conn)
        or die(mysql_error());

    while ($row1 = mysql_fetch_array($results1)) {
      extract($row1);
      echo '<h2><a href ="search1.php?category=' . 
       $row1['category_name'] . '"><img src=' . htmlspecialchars($row1['category_name']) .
	   "align=\"left\"></a>" . htmlspecialchars($row1['category_name']) . "</h2>";

 

Thanks in advance

 

Hi there, I am building a film scouts website and need to display a lot of images on one page selected via a database. Curently the images are listed vertically on the page but I want them horizontally listed.

 

the code is something like this

$query1 = "SELECT category_id, category_name " .
               "FROM cms_categories " .
               "ORDER BY category_name";
		   
      $results1 = mysql_query($query1,$conn)
        or die(mysql_error());

    while ($row1 = mysql_fetch_array($results1)) {
      extract($row1);
      echo '<h2><a href ="search1.php?category=' . 
       $row1['category_name'] . '"><img src=' . htmlspecialchars($row1['category_name']) .
	   "align=\"left\"></a>" . htmlspecialchars($row1['category_name']) . "</h2>";

 

Thanks in advance

 

I don't use <h#> tags often so I don't know for sure but try removing those tags, I think they're used for headings so they get their own line, and line break for the proceeding content.

ok, I have now been trying to align the text below the images aligning with the left side. with css i can only get the text to sit either side. If I put a <BR> tag between the image and the text the whole thing goes back to aligning vertically again.

I'd like to see the images all spaced equally apart from each other with the text aligned to the left of the image. You would think that would be easy ....but...

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.