Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3976638
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:49:42+00:00 2026-05-20T04:49:42+00:00

I have the following sql query that fetches images from an establishment table. The

  • 0

I have the following sql query that fetches images from an establishment table.
The main photo ie, establishment_mainphoto_url is always inputed and can never be left null. However, the other 5 fields can contain photos or be left null, or a combination of some null and some not.

I have a jcarousel slide-image show that calls images from an unordered list for display.

The code:

$establishment_id = $row_establishment_view['establishment_id'];
$carouselSQL = mysql_query("SELECT establishment_mainphoto_url,
                                 establishment_photo_url1, 
                                 establishment_photo_url2, 
                                 establishment_photo_url3, 
                                 establishment_photo_url4, 
                                 establishment_photo_url5                                   
                                 FROM establishment 
                                 WHERE establishment_id=$establishment_id");
$carouselImg = mysql_fetch_assoc($carouselSQL);  

The jquery carousel code:

<div class="carousel_container"><!--Carousel list of images-->
                    <div class="infiniteCarousel">
                       <div class="wrapper">
                           <ul>
                           <?php if(!empty($carouselImg['establishment_mainphoto_url'])) {?>                                                                                        
                               <li><img alt="" src="Establishment_Images/<?php echo $carouselImg['establishment_mainphoto_url'];?>" height="390" width="500"/></li> 
                           <?php } ?>
                           <?php if(!empty($carouselImg['establishment_photo_url1'])) {?>   
                               <li><img alt="" src="Establishment_Images/<?php echo $carouselImg['establishment_photo_url1'];?>" height="390" width="500"/></li>
                           <?php } ?>
                           <?php if(!empty($carouselImg['establishment_photo_url2'])) {?>   
                               <li><img alt="" src="Establishment_Images/<?php echo $carouselImg['establishment_photo_url2'];?>" height="390" width="500"/></li> 
                           <?php } ?>  
                           <?php if(!empty($carouselImg['establishment_photo_url3'])) {?>     
                               <li><img alt="" src="Establishment_Images/<?php echo $carouselImg['establishment_photo_url3'];?>" height="390" width="500"/></li> 
                           <?php } ?>
                           <?php if(!empty($carouselImg['establishment_photo_url4'])) {?>   
                               <li><img alt="" src="Establishment_Images/<?php echo $carouselImg['establishment_photo_url4'];?>" height="390" width="500"/></li> 
                           <?php } ?> 
                           <?php if(!empty($carouselImg['establishment_photo_url5'])) {?>      
                               <li><img alt="" src="Establishment_Images/<?php echo $carouselImg['establishment_photo_url5'];?>" height="390" width="500"/></li>
                           <?php } ?>                    
                           </ul> 
                       </div>   
                    </div>   
                </div> 

Say a user enters the establishment_mainphoto_url, establishment_photo_url1 and establishment_photo_ur4 and leaves the other fields empty.

Right now the carousel shows the images but with blanks in between. E.g after the main image and image 1, it will have 2 blank “images” where 2 and 3 are supposed to be and then image 4 will show, then a blank for 5, and the carousel then starts over.

How do I fix it so that the 3 images show in line in the slideshow with no “blanks”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T04:49:42+00:00Added an answer on May 20, 2026 at 4:49 am
    <div class="carousel_container"><!--Carousel list of images-->
    <div class="infiniteCarousel">
       <div class="wrapper">
           <ul>
           <?php
           foreach ( $carouselImg as $image ) {
               if ( empty($image) ) continue;
               echo '<li><img alt="" src="Establishment_Images/' . $image . '" height="390" width="500"/></li>';
           }
           ?>
           </ul> 
       </div>   
    </div>   
    </div> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CMS that requires a SQL query to return options/values for a
I have a fairly complex query in SQL that performs a count across two
I have a table similar to the following ID NUMBER VAL1 NUMBER VAL2 NUMBER
I have an SQL query (generated by LINQ to Entities) which is roughly like
I'm trying to build a filtering system for products. Products have many attributes including
I have 2 tables: Person and Item. I just created a new column in
I'm new to programming so I'm sorry in phrasing if I'm not asking this
I've read DDD Evans, and I' experimenting with an aggregate root repository design using
I am working on proof-of-concept code to dynamically generate CAML based on keywords provided
I'm new to LINQ and am finding it a bit difficult with understanding some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.