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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:21:24+00:00 2026-05-28T06:21:24+00:00

i need some help with a little problem that occurred today. To show the

  • 0

i need some help with a little problem that occurred today.

To show the latest posts in website, i use this script, also this script exclude some categories (my website is not in wordpress,but the db names has wp in front)

  SELECT
  ID, 
  post_title, 
  post_content, 
  post_date, 
  GROUP_CONCAT(DISTINCT post_category ORDER BY post_category DESC SEPARATOR ", " ) as "categories"

  FROM 
  wp_posts, 
  wp_term_relationships,
  wp_term_taxonomy 

  WHERE wp_posts.post_status = "publish"    
  AND wp_term_relationships.object_id = id
  AND wp_term_taxonomy.taxonomy= "category"
  AND !(wp_term_taxonomy.term_taxonomy_id = 34472 ||
        wp_term_taxonomy.term_taxonomy_id = 34473 ||
        wp_term_taxonomy.term_taxonomy_id = 34474 ||  
        wp_term_taxonomy.term_taxonomy_id = 17)
  AND wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id

  GROUP BY ID, post_title, post_content, post_date 
  ORDER BY wp_posts.post_date DESC LIMIT 150

Now the problem is that i need to get only the today posts, so i add to this script this:

AND DATE(post_date) >= CURRENT_DATE

but after adding this, i see that many posts that are in some categories not only one, they are showed twice or more times.
Can some one help me to solve this issue?
Thank you

Please 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-05-28T06:21:24+00:00Added an answer on May 28, 2026 at 6:21 am

    Since post_date is part of your GROUP’ing, you should add the following right after the GROUP BY clause and before the ORDER BY clause (don’t use it as a WHERE clause):

    ...
    HAVING DATE(post_date) >= CURDATE()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help with this problem in implementing with XSLT, I had already implemented
I ran into a little problem and need some help: If I have an
I need some help with overlaying views using the prism framework.Its a little more
I am getting a little confused and need some help please. Take these two
Need some help to solve this. I have a gridview and inside the gridview
Need some help gathering thoughts on this issue. Our team is moving ahead with
Need some help assigning a mouseover event to display some icons that start out
I need some help from the shell-script gurus out there. I have a .txt
I have a little problem, I hope U can help me;) Trouble is, that
Guys i need some help here , im getting this error here at the

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.