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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:08:23+00:00 2026-06-12T01:08:23+00:00

I want to implement a search function in my application based on these tables.

  • 0

I want to implement a search function in my application based on these tables.

I have 5 fields on search page

  1. Input box – Keywords or any word in the title
  2. Author – Select Box (author_id will be passed to the function as value)
  3. Category Name – Select Box (category_id will be passed to the function as value)
  4. themonth – Select Box from 1 – 12
  5. theyear – Select Box from 2000 – 2012

I want to create a search query from based upon these rules,

  1. Results array will be sorted by insights.read_time, (how many times the article has been read)
  2. Only want to get the article.article_id

Pre-mature working working example is here

I am running following query to get but it is not complete
https://leading-people.com/search

SELECT article.article_id FROM article WHERE
article.is_active = ‘1’ AND (content LIKE ‘%%’ OR title LIKE
‘%%’ OR tags LIKE ‘%%’) UNION ALL SELECT article.article_id
FROM keywords INNER JOIN article WHERE article.is_active = ‘1’
AND (article.article_id = keywords.article_id AND
keywords.keywordtext LIKE ‘%%’)

TABLE article
COLUMNS

  • article_id (PRIMARY)
  • is_active
  • title
  • themonth
  • theyear

TABLE article_author

Comments: This table is just for reference author details is in another table. So these id(s) are just for reference.

COLUMNS

  • article_author_id (PRIMARY)
  • author_id
  • article_id

TABLE article_categories

Comments: This table is just for reference categories details is in another table. So these id(s) are just for reference.

COLUMNS

  • article_categories_id (PRIMARY)
  • article_id
  • categories_id

TABLE insights

Comments: This table is just for reference categories details is in another table. So these id(s) are just for reference.

COLUMNS

  • insights_id (PRIMARY)
  • article_id
  • read_time

TABLE keyword

Comments: This table is just for reference categories details is in another table. So these id(s) are just for reference.

COLUMNS

  • keyword_id (PRIMARY)
  • article_id
  • keywordtext

Hope! I’ve formatted it correctly so everyone can understand!

  • 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-12T01:08:24+00:00Added an answer on June 12, 2026 at 1:08 am

    After struggling for 6,7 hours, I was amazed that it was so simple 🙁

    Here is the solution that I came up with

    SELECT article.article_id FROM article WHERE $cond (content LIKE ‘%$term%’ OR title LIKE ‘%$term%’ OR tags LIKE ‘%$term%’)
    AND article.article_id IN (SELECT article_categories.article_id FROM article_categories WHERE categories_id LIKE ‘$cat’) AND article.article_id IN (SELECT article_author.article_id FROM article_author WHERE author_id LIKE ‘$author’)

    UNION ALL SELECT article.article_id FROM keywords INNER JOIN
    article WHERE $cond (article.article_id =
    keywords.article_id AND keywords.keyword LIKE ‘%$term%’) AND
    article.article_id IN (SELECT article_categories.article_id
    FROM article_categories WHERE categories_id LIKE ‘$cat’) AND
    article.article_id IN (SELECT article_author.article_id FROM
    article_author WHERE author_id LIKE ‘$author’)

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

Sidebar

Related Questions

I want to implement a search function on any field of Elmah errors, beside
I have to implement a 'global' search/filter function in my application. Each window that
I want to implement in my webpage something similar to google search page. The
I want to implement a search box in my website with autocompleting text together
I'm trying to implement a simple search function. I have a string array which
I have been trying to implement a search page for the admin of my
I want to implement a basic search/replace translation table in C; that is, it
I want to implement the Global search for the Leads for the Primary address
i starter in jqgrid, i want implement inline edit in jqgrid i have this
I want to implement an application which will work as a parser. User will

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.