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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:33:08+00:00 2026-05-19T22:33:08+00:00

I am very, very new at PHP and I am trying to fix a

  • 0

I am very, very new at PHP and I am trying to fix a code that someone else wrote. I managed to do a couple of fixes and now the search is working, but I just can’t get the “No Records Found” message.

I am a novice trying to teach myself, so any feedback is appreciated. Thank you in advance.

Here is my code:

Blockquote

<?php $counter = 0;
      while ($data_main = mysql_fetch_object($rs_main)) { ?>            
          <div id="thumbnail_div">
            <a href="more_info.php?id=<?php echo $data_main->iuniqid; ?>"><*image here*/<?php echo $data_main->prefix; ?>_<?php echo stripslashes($data_main->iname); ?>" border="0" /></a><br />
            <?php if ($data_main->itype != '') { 
                    $sql_type = " select itype from type where id = ". $data_main->itype;
                    $rs_type = mysql_query($sql_type);
                    $data_type = mysql_fetch_object($rs_type);  ?>
            <*image here*<?php echo $data_main->itype; ?>.*extension*" width="10" height="10" alt="<?php echo $data_type->itype; ?>" title="<?php echo $data_type->itype; ?>" /> 
            <?php } ?>
            <?php if ($data_main->iotype != '' ) { 
                    $sql_otype = " select itype from original_type where id = ". $data_main->itype;
                    $rs_otype = mysql_query($sql_otype);
                    $data_otype = mysql_fetch_object($rs_otype); ?>         
            <*image here*<?php echo $data_main->iotype; ?>.*extension*" width="10" height="10" alt="<?php echo $data_otype->itype; ?>" title="<?php echo $data_otype->itype; ?>" /><br />
            <?php } ?>
          <span class="textBody">Image ID <?php echo $data_main->iuniqid; ?></span>
         </div>      
<?php   $counter++;
        if ($counter == 5) {
            $counter = 0; ?> 
            <div id="separatordiv">   </div>
<?php   }
      } ?>
            <div style="clear:both;"></div>
            <div align="center"><?php echo $page->get_page_nav(); ?></div> 

Blockquote

  • 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-19T22:33:08+00:00Added an answer on May 19, 2026 at 10:33 pm

    You just want to show that message? Put this before or after the while loop:

    <?php 
    if (mysql_num_rows($rs_main) == 0) {
        echo "No records found.";
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to php. I found some CMS like code for east text
I am very new to php, and I am trying to develop a facebook
I am very new to jQuery, I am customizing my PHP project and trying
I am very new to OOP styled PHP, and I am trying to implement
I'm trying to write a php script that will generate a variety of new
I am very new to PHP and trying to select data from a MySQL
I'm very new to PHP so far and have been trying to learn it.
I am very new to PHP, trying to write a script which connects to
Very new to PHP/programming in general, and I've been trying to run a PHP
im very new at javascipt (im php developer) so im really confused trying to

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.