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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:52:49+00:00 2026-05-27T18:52:49+00:00

I have an image gallery with a vote function, and I’m trying to display

  • 0

I have an image gallery with a vote function, and I’m trying to display the number of votes for each image from the database.

I have a Votes table with the following…

vote_id │ user_id │ session_id │ ip │ created_date │ status

I am trying to get the number of votes for each image to display (several images per page), but only 1 vote per ip and only within the last week (Mon to Sun).

I’m not a genius when it comes to this sort of thing, but this is what I have been able to do so far to get results in SQL. I’ve been getting a bit stuck trying to implement it into PHP…

SELECT COUNT(DISTINCT ip) AS Votes FROM 'vote' (I know its basic but there you go)

  • 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-27T18:52:50+00:00Added an answer on May 27, 2026 at 6:52 pm

    Here is 🙂


    SELECT COUNT(DISTINCT ip) AS Votes, WEEK(created_date) AS week_num FROM 'vote'
    group by WEEK(created_date)
    order by week_num DESC

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

Sidebar

Related Questions

I have made an image gallery. What currently happens is the following. I display
I have created a XML image gallery, which displays text in between each slide.
I have a table for image gallery with four columns like: foid | uid
I have an image selector that allows to choose an image from a gallery,
I am trying to make an image gallery where you have a thumb of
I have implemented a image gallery where in each image is differentiated by its
I have taken thumbnail image from gallery which is smaller in size and resized
I have a custom image gallery which populates a div with thumbnails, each contained
I have an image gallery with say 39 number of images. Two buttons prev
I have an image gallery which pulls in random images from the folder images/flip_images/.

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.