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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:02:04+00:00 2026-06-06T03:02:04+00:00

I am trying to achieve dynamic META information so that it will allow META

  • 0

I am trying to achieve dynamic META information so that it will allow META information to be inserted depending on the page that you are viewing.

I Have 3 tables

CATEGORIES
  category_id,
  category_name,
  category_title,
  category_url,
  site_id,

SITE
  site_id,
  site_name,
  site_url,
  meta_kw,
  meta_desc,

CATEGORY_META
  site_id,
  category_id,
  meta_keywords,
  meta_description,

I am trying to run a query that allows for the population of the META information from the SITE table if no information exists inside the CATEGORY_META table. To achieve this I am looking at the “category_url” that exists and gleaning the “category_id” from that to run a subquery. However it is returning an empty row which I do not want and is causing errors.

My Query looks like this:

SELECT category_id, s.meta_kw, s.meta_desc, m.meta_keywords, m.meta_description
FROM cms_sites s
LEFT JOIN cms_category_meta m
ON s.site_id=m.site_id AND m.category_id = 
(SELECT category_id FROM cms_categories WHERE category_url='?')

which returns:

 |category_id  |meta_kw  |meta_Desc | meta_keywords  |meta_description  |
 |NULL         |kw       |desc      |NULL            |NULL              |
 |NULL         |         |          |NULL            |NULL              |

I am relatively new to MySQL and any help would be greatly appreciated.

  • 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-06T03:02:06+00:00Added an answer on June 6, 2026 at 3:02 am

    Try this:

    SELECT 
      category_id, s.meta_kw, s.meta_desc, m.meta_keywords, m.meta_description
    FROM cms_sites s 
    LEFT JOIN cms_category_meta m ON s.site_id = m.site_id 
    LEFT JOIN cms_categories cat ON m.category_id = cat.category_id
                                AND cat.category_url = '?'
    

    Anyway, if you have some “empty” row as @jlcd told you, this won’t solve you problem.

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

Sidebar

Related Questions

I'm trying to write a dynamic form for models that allow users with different
I have trying to achieve SVG element's animation while adding dynamic DOMs for its
im trying to achieve something but i dont really know how I have set
I'm trying to achieve an effect similar with youtube home page (you must be
I am trying to achieve an LDAP query to gather all properties we have
What I am really trying to achieve is an array of dynamic byte patterns
Trying to achieve the goal of printing selected page's element ONE-TO-ONE - the exact
I am trying to create a dynamic lambda expression (parsed from text), that does
Lets say that I have a database structure with three tables that look like
I'm trying to achieve a dynamic two dimensional array in C. Whenever the program

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.