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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:45:31+00:00 2026-06-15T02:45:31+00:00

I was using this script and everything was great except for the fact that

  • 0

I was using this script and everything was great except for the fact that when the actual search was executed and “No Results” was the answer, I wanted the script to display such.

When doing research to see where the FAIL was I discovered that I should be using MySQLi. I have been at this script for 2 days and I seem to be getting further instead of closer. A little help here fellas?

What I am using:

    if(empty($_GET['query'])){
header ("Location: /same_page");
}
else{
//connect
include 'connection_script.php';

//Get the "Term" from the search box
$query=mysql_real_escape_string($_GET['query']);

$page_str = "SELECT * FROM $tblname WHERE name like '%$query%' or clan like '%$query%'";

$page_query = mysqli_query($con,$page_str)or die(mysql_error($con));

while($page_result = mysqli_fetch_assoc($page_query)){$datarow .= " <ul>
<li>Banned player : <a target='_blank' href=\"http://path/tosomething/here=" . $page_result[name] . " \">" . $page_result[name] . "</a></li>
<li>Clan Name : " . $page_result[clan] . "</li> 
<li>Reason : " . $page_result[reason] . "</li>
<li>Posted By : " . $page_result[moderator] . "</li>
<li>Date & Time : " . $page_result[dateandtime] . "</li>
<li>Evidence : <a target='_blank' href=\"$page_result[evidence]\">Here</a></li>
</ul><br />";
}

echo $datarow;
echo "<br />";

include 'dbclose.php';
}

mysql_close($con);
  • 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-15T02:45:32+00:00Added an answer on June 15, 2026 at 2:45 am

    Just add a condition to display something if your query returns 0

          if(empty($_GET['query'])){
    header ("Location: /same_page");
    }
    else{
    //connect
    include 'connection_script.php';
    
    //Get the "Term" from the search box
    $query=mysql_real_escape_string($_GET['query']);
    
    $page_str = "SELECT * FROM $tblname WHERE name like '%$query%' or clan like '%$query%'";
    
    $page_query = mysqli_query($con,$page_str)or die(mysql_error($con));
    
    if (mysqli_num_rows($page_query) > 0){
    
    while($page_result = mysqli_fetch_assoc($page_query)){$datarow .= " <ul>
    <li>Banned player : <a target='_blank' href=\"http://path/tosomething/here=" . $page_result[name] . " \">" . $page_result[name] . "</a></li>
    <li>Clan Name : " . $page_result[clan] . "</li> 
    <li>Reason : " . $page_result[reason] . "</li>
    <li>Posted By : " . $page_result[moderator] . "</li>
    <li>Date & Time : " . $page_result[dateandtime] . "</li>
    <li>Evidence : <a target='_blank' href=\"$page_result[evidence]\">Here</a></li>
    </ul><br />";
    }
    
    echo $datarow;
    echo "<br />";
    } else {
    echo 'Your search returned 0 results';
    }
    
    include 'dbclose.php';
    }
    
    mysql_close($con);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file hosting site that's using this script MFHS . I want
I am using this great version of jQuery Tablesorter: http://mottie.github.com/tablesorter/docs/index.html Everything is working well
I've been using this script for a long time and it works perfectly in
I compress my files using this script import pylzma, struct i = open(path+fileName,'rb') o
I'm using this script below for loading a hidden div, inside another: $(document).ready(function(){ $(function()
I'm using this script which works fine for a single lightbox popup window. I
Hay, i'm using this script function preloader(images){ var i = 0; imageObj = new
Recently I've been looking at opening a tab using this script: $('.tofour').click(function() { //
i have only ftp credentials in which i am using this script $r=mysqldump $dbuser
in my site i want to set default page to open, using this script

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.