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 9169029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:46:21+00:00 2026-06-17T15:46:21+00:00

So, I am scratching my head on this one. My original IF statement is

  • 0

So, I am scratching my head on this one. My original “IF” statement is not executing when true (I know it’s true because I have echoed the variable and it’s what should trigger the code). BUT, if the IF statement is not true, the elseif and else statements work fine. Here is the code:

    <?php
    $count=mysql_num_rows($result);
    // have also tried only one "=" sign//
    if ($count==0){
        //This is not appearing//
        echo "Your search did not yield any results. Please try another search."; 
    } else if ( //other conditions// ) {
        //code that is working fine//
    } else {
        // more code that is working fine 
        // (happens to be the same as the original if statement)
    }
    echo $count; //is printing 0 correctly, but the if statement for $count=0 not happening//
    ?>

Any ideas?

  • 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-17T15:46:23+00:00Added an answer on June 17, 2026 at 3:46 pm

    Ok, had a guy at work look at it and he found the error. It was in something I didn’t report because I didn’t think it would have an effect. I had a while statement before the original if, but I didn’t need it to execute unless the if was false. When I moved it to below the original if and changed elseif to another if bracketed within the while statement, it worked fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been scratching my head for a while on this one. I dont
I'm really scratching my head on this one: I have an object (MyObject) which
I'm scratching my head over this one. Below is a running sample. I have
This one is quite tricky i've been scratching my head all day. I have
I have been scratching my head on this one for a while, so I
I have been scratching my head on this one for some time now and
I am not a expert query writer . Scratching my head over this one
Ok, been scratching my head on this one for a bit now... seems related
It's late on a Friday and I'm scratching my head on this one. I'm
This one has me scratching my head, so I'm hoping a second pair of

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.