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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:23:49+00:00 2026-05-20T07:23:49+00:00

I use the query below for searching, SELECT pg_id AS ID, pg_url AS URL,

  • 0

I use the query below for searching,

SELECT
pg_id AS ID, 
pg_url AS URL,
pg_title AS Title,
pg_content_1 AS Content_1,
pg_content_2 AS Content_2,
parent_id AS Parent_id,

EXTRACT(DAY FROM pg_created) AS Date,
EXTRACT(MONTH FROM pg_created) AS Month,
EXTRACT(YEAR FROM pg_created) AS Year

FROM root_pages

WHERE root_pages.pg_cat_id = '2'
AND root_pages.parent_id != root_pages.pg_id
AND root_pages.pg_hide != '1'
AND root_pages.pg_url != 'cms'
AND root_pages.pg_content_1 REGEXP '[[:<:]]".$search."[[:>:]]'
OR root_pages.pg_content_2 REGEXP '[[:<:]]".$search."[[:>:]]'

ORDER BY root_pages.pg_created DESC

I works fine but I don’t want it to search the keyword in the URL address such as,

If I search for the keyword of home, the query will search any matches of ‘home’ in the URLs below and return them as the result too:

http://epp.eurostat.ec.europa.eu/xx/eurostat/home/

http://ec.europa.eu/home-affairs/doc_centre/xx.pdf

How can I fix the query so that it won’t match the keyword in an URL or it should match the whole word only?

Thanks.

  • 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-20T07:23:50+00:00Added an answer on May 20, 2026 at 7:23 am

    EDIT:

    Found my own solution and it seems to work fine as it skips searching the text in the column with http://

    SELECT
    pg_id AS ID, 
    pg_url AS URL,
    pg_title AS Title,
    pg_content_1 AS Content_1,
    pg_content_2 AS Content_2,
    parent_id AS Parent_id,
    
    EXTRACT(DAY FROM pg_created) AS Date,
    EXTRACT(MONTH FROM pg_created) AS Month,
    EXTRACT(YEAR FROM pg_created) AS Year
    
    FROM root_pages
    
    WHERE root_pages.pg_cat_id = '2'
    AND root_pages.parent_id != root_pages.pg_id
    AND root_pages.pg_hide != '1'
    AND root_pages.pg_url != 'cms'
    AND root_pages.pg_content_1 LIKE '%".$search."%'
    OR root_pages.pg_content_2 LIKE '%".$search."%'
    
    AND root_pages.pg_content_1 NOT LIKE '%http://%'
    AND root_pages.pg_content_2 NOT LIKE '%http://%'
    
    ORDER BY root_pages.pg_created DESC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm use below query for fetch my data with an ordernumber... SELECT Details.Quantity, Details.OrderNumber,
I use the below code to write code to query a web method in
I want to use a query like: sql(select name where id > 10 and
Can a select query use different indexes if a change the value of a
I use the query below to detect a 10 centimeter difference between the average
I'm attempting to use multiple ANDs in this query below, and it messes up
Using EXPLAIN for the query below shows SELECT cha.cid AS cid, cha.data AS dl
I'm wondering the following, the query below will select the appropriate fields if a
I am trying to use the query below (which works perfectly), as a subquery
I'm trying the query below and MySQL gave me this error: Invalid use of

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.