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 following SQL query that selects some results from my table: select avg(c3),
I have the following query in SQL Server 2005 that fetches the result that
I have the following SQL query: SELECT DISTINCT ProductNumber, PageNumber FROM table I am
I have the following table: I am trying to create an SQL query that
I have the following SQL query that works like a champ: select u.id from
I have the following sql statement that is working properly. SELECT * FROM table
I currently have the following SQL query that lists all the names of all
I have following SQL query SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability FROM Nodes INNER
I have the following SQL Server query: SELECT area FROM places WHERE REPLACE(area,'-',' ')
I have the following SQL query that I want to do using Core Data:

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.