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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:42:10+00:00 2026-06-04T09:42:10+00:00

I have a very complex issue that Me and my coworker have been discussing

  • 0

I have a very complex issue that Me and my coworker have been discussing for a long time today and we just can’t seem to get to the answer, wondering if anyone here has a bright idea we have missed.

$tags=mysql_real_escape_string($_GET["tags"]);
$tags="SELECT * FROM i WHERE tip LIKE '%".$tags;
$tags=str_replace(",","%' OR tip LIKE '%",$tags);
$tags=$tags."%'";
$qtags = mysql_query($tags) or die(mysql_error());

example: $tags=’word,phrase,term,foo,bar,anything’

tags are pulled from a paragraph written by a user and then compared with paragraphs stored in ‘i’ (sql database).

the problem we are facing is how to identify what/which ‘tag’ (out of the tags string) caused the result.

example: the resulting paragraph was like the tag ‘foo’ from the string $tags which was ‘word,phrase,term,foo,bar,anything’ how can we identify foo as the cause?

  • 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-04T09:42:11+00:00Added an answer on June 4, 2026 at 9:42 am

    You could try something like this:

    SELECT
        CASE WHEN tip LIKE '%foo%' then 'foo'
             WHEN tip LIKE '%bar%' then 'bar'
             WHEN tip LIKE '%anything%' then 'anything'
        END as MatchedTag,
        i.*
    FROM i
    WHERE tip LIKE '%foo%'
       OR tip LIKE '%bar%'
       OR tip LIKE '%anything%'
    

    It would need to be generated from your $tags variable like your current query.

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

Sidebar

Related Questions

We have a very complex Oracle package here (over 4,100 lines of code) that's
I have a very complex process that involves downloading a number of files from
I have a complex issue at hand. I have developed a program that takes
So, we have a very large and complex website that requires a lot of
I have a very complex controller with a very complex set of views and
I have a very complex web app project I want to re-structure. Naturally, it
I have a very complex Microsoft Access report. This report is run for multiple
I have a rather complex data source for my UITableView. I am very carefully
i have very serious problem if any tech expert can help...thank you in advance..
I want to describe an issue I have been having with Plot using With

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.