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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:48:29+00:00 2026-06-02T20:48:29+00:00

I am trying to pull posts from a specific month that has been clicked

  • 0

I am trying to pull posts from a specific month that has been clicked on, on a different page….. So to make it a little more clear.

I have a page which displays each month that a post has been made in, I then have a second page that page one is linked to. The second page is for showing the posts from the month that has been selected in the previous page.

below is the code to display the months and the link I created for the user to click on

$months = mysql_query("SELECT DISTINCT(MONTHNAME(date)) as post_month
                       FROM article
                       LIMIT 12");


while($row = mysql_fetch_array($months)){
    echo "<a href=\"montharticles.php?id=" . $row['0'] . "\">" . $row['0'] . "</a><br/>";
}

below is the code for the second page

$article = mysql_query("SELECT article_id, content, DATE_FORMAT(date, '%d %b %y') 
                       FROM article
                       WHERE article_id = $_GET[id]");


while($row = mysql_fetch_array($article)){
    echo $row . "</br>";
}

my issue is that when page two is opened I get an error message.

I have removed $_GET[id] and replaced it with a number, doing this just displays “array”
I have also tried $_GET[month] but no luck

I realise that there is a problem with the $_GET[] part of the statement and that if a month is clicked I need to make whats in the address bar = to whats in the $_GET command, but I cant work out how to do it.

  • 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-02T20:48:30+00:00Added an answer on June 2, 2026 at 8:48 pm

    In your code $row is an array that includes an entire row of the result set.

    To access a particular column in the row, you need to do something like this:

    echo $row['article_id'];
    

    You’ll probably want to use an alias for the date column like this:

    SELECT article_id, content, DATE_FORMAT(date, '%d %b %y') AS date_column
    

    So you can do this:

    echo $row['date_column'];
    

    Instead of this:

    echo $row["DATE_FORMAT(date, '%d %b %y')"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to pull excerpts and custom fields from specific posts, I have
I been trying to pull a value from a Param Name that is loaded
I have been requested by a client to pull the latest posts from their
I would like to pull artifacts from teamcity. I've been trying to use c#
Just trying to pull off some SMART info from connected Hard Drives on any
I'm trying to pull in data from a remote SQL Server. I can access
I am trying to pull registry info from many servers and put them all
I am trying to pull information from another site. When I try and do
I am trying to pull out data from the table I had from the
I am trying to pull data from a table I have imported into my

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.