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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:55:28+00:00 2026-06-11T07:55:28+00:00

Not sure what this is called so that limits my ability to search for

  • 0

Not sure what this is called so that limits my ability to search for an answer.

I have a table with form submissions, each row is a single field from this form. Each group of fields (each submission) is tagged with a timestamp and an index number, such as 3247623445.8446. Each row also has a column that states the name of the field, and then another with the value for that field.

I need to select all of this data for export, grouping all the rows that in end in the same last 4 digits, so I can preferably create an associative array as such: $rows['8446'][fieldname] = $value.

  • 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-11T07:55:30+00:00Added an answer on June 11, 2026 at 7:55 am
    SELECT ...
    ...
    GROUP BY RIGHT(yourfield, 4)
    

    would do the trick, assuming those numbers are stored as strings and not floats/doubles.

    Of course, on a second read of your question, I’ve probably got that wrong. For your grouping in PHP, it’d be

    while($row = mysql_fetch_assoc($result)) {
       $digits = substr($row['yourfield'], -4, 4); // get rightmost 4 chars
       $rows[$digits]...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not even sure what this principle is called or how to search for
Hey, I have a table called products that has a relationship with itself. This
My apologies for an inaccurate title, but I'm not sure what this is called
I'm not even sure what this is called? But I'm trying to learn what
Not sure this is possible, but looking to write a script that would return
I'm not sure what this is called, which is why I'm having trouble searching
I'm not quite sure what this is called, but I've spent some time thinking
This is my scenario: I have a table that contains events, every event has
I'm not sure what this is called since it is new to me, but
Not sure this is a known issue. I’m using VS2012 RC (Ultimate), and Win8

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.