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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:07:46+00:00 2026-06-08T19:07:46+00:00

I am using Paper Mashups Autosuggest. I just finished doing a mysql union to

  • 0

I am using Paper Mashups Autosuggest.

I just finished doing a mysql union to bring three tables into one so I could autosuggest names of companies, names of categories and names of subcategories. Unfortunately, while that worked, it added extra li’s ( I think that’s what they are, here’s the picture.)

How do I get rid of those extra li’s?

Here’s my code:

<?php
$db = new mysqli('localhost', 'root' ,'*********', '****************');

if(!$db) {

    echo 'Could not connect to the database.';
} else {

    if(isset($_POST['queryString'])) {
        $queryString = $db->real_escape_string($_POST['queryString']);

        if(strlen($queryString) >0) {
            $query = $db->query("SELECT name FROM company WHERE name LIKE '$queryString%' UNION SELECT cat FROM cat WHERE cat LIKE '$queryString%' UNION SELECT subcat FROM subcat WHERE subcat LIKE '$queryString%' LIMIT 10");
            if($query) {
            echo '<ul>';
                while ($result = $query ->fetch_object()) {
                    echo '<li onClick="fill(\''.addslashes($result->name).'\');">'.$result->name.'</li>';
                    echo '<li onClick="fill(\''.addslashes($result->cat).'\');">'.$result->cat.'</li>';
                    echo '<li onClick="fill(\''.addslashes($result->subcat).'\');">'.$result->cat.'</li>';
                }
            echo '</ul>';

            } else {
                echo 'OOPS we had a problem :(';
            }
        } else {
            // do nothing
        }
    } else {
        echo 'There should be no direct access to this script!';
    }
}
?>

Thanks for all help!

  • 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-08T19:07:48+00:00Added an answer on June 8, 2026 at 7:07 pm

    Looks to me like it’s spitting out blanks. Try just using name first, then just cat, then just subcat to find the culprit. Also, your subcat in your three echoes is echoeing cat instead of subcat…

    echo '<li onClick="fill(\''.addslashes($result->subcat).'\');">'.$result->cat.'</li>';
    

    Should be:

    echo '<li onClick="fill(\''.addslashes($result->subcat).'\');">'.$result->subcat.'</li>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a paper using the ACM template which capitalizes every letter in
I am developing ' Paper Toss' for iphone using cocos2d & I would like
I'm using the LLNCS layout for a latex paper. The page numbers are suppressed
I'm trying to determine the current paper type selection on the default printer using
I'm not using a Grid, just using the MvcContrib Pager. I have a partial
I wrote a research paper in latex and generated pdf using Kile. Now I
How to draw circular segment using paper.js I want to draw the circular segments
I'm implementing the component labelling algorithm as in this paper using python and opencv.
I am working on a system that is recognizing paper documents using OCR engines.
I can get the current Locale paper size using GetLocaleStr(LCID,LOCALE_IPAPERSIZE,IntToStr(DMPAPER_A4)) where LOCALE_IPAPERSIZE = $100A

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.