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

  • SEARCH
  • Home
  • 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 9023761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:50:19+00:00 2026-06-16T05:50:19+00:00

Not sure why this is giving me hell – but I am sure it

  • 0

Not sure why this is giving me hell – but I am sure it is an easy fix, that I’m just not seeing.. ?

My query that shows 7 event logos that are upcoming..

[LOGO] [LOGO] [LOGO] [LOGO] [LOGO] [LOGO] [LOGO]

$query_Recordset3 = "SELECT id, event_type, event_type_2, event_name,
event_logo,event_date  FROM event_calendar WHERE review_live = 1 AND
event_logo > '0' AND event_date >= CURDATE() ORDER BY event_date ASC
LIMIT 7";

My little problem: If I have event without a logo.. so it shows just one or a couple instead of 7.

How it is now if there is two events with logos:

[LOGO] [LOGO] [x] [x] [x] [x] [x]

I am trying to come up with a way to show a default for the rest of my “logo images”

How I want it to look

[LOGO] [LOGO] [default] [default] [default] [default] [default]

Is my query not right or do I just need to do a fancy “do while” ??

Thanks my NINJAS!! Sorry if there is other do while and query questions.. i just didn’t find exactly what i was looking for 🙂

  • 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-06-16T05:50:21+00:00Added an answer on June 16, 2026 at 5:50 am

    Just count the number of rows you got and then fill up until you have 7 logos

    <?php
    $query_Recordset3 = "SELECT id, event_type, event_type_2, event_name,
    event_logo,event_date  FROM event_calendar WHERE review_live = 1 AND
    event_logo > '0' AND event_date >= CURDATE() ORDER BY event_date ASC
    LIMIT 7";
    
    $result = $mysqli->query($query_Recordset3) or die(mysqli_error());
    for ($i = 0; $row = $result->fetch_row(); $i++) {
        // process row, show logo
    }
    
    for (; $i < 7; $i++) {
        // show default
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure this is possible, but looking to write a script that would return
I'm not sure I'm giving the right name to this, but anyway I have
I'm not sure this is even possible but I know if it is, the
I'm not sure this is possible, but in ruby, you can dynamically call a
I'm not sure this is possible, but is there a syntax to be used
I'm not sure this question is appropriate here but I hope I could get
This code is giving me a SyntaxError. Not sure what is wrong. import numpy
So I'm not quite sure why this one is giving me so much trouble
Not sure if this belongs on SO but nonetheless it involves web dev/programming... I
I am not sure about this and googling is not giving me a clear

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.