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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:05:48+00:00 2026-05-25T23:05:48+00:00

I have an array of 50+ elements that dictates how many hours were worked

  • 0

I have an array of 50+ elements that dictates how many hours were worked for a given week.

What is the proper way to store this information into a database table?

My initial idea was to use a delimiter, but the text is too large (280 characters) to fit.

Additionally, there seems something “wrong” with creating a table column for each element.

Ideas?

Array using delimiter (comma):
37.5,37.5,37.5,37.5,37.5,37.5,37.5,37.5,37.5,37.5, …

  • 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-25T23:05:49+00:00Added an answer on May 25, 2026 at 11:05 pm

    The “proper” way is to store the array’s contents as multiple rows in a whole other table, each with a foreign key referencing the record they belong to back in the first table. There may be other things that work for you, though.

    [EDIT]: From the details you added I’m guessing your array elements consist of a number of hours worked each week and you have 50+ of them because a year has 52-ish weeks. So what I think you’re looking for, is I guess that your current (main) table is called something like “employees,” is that each row there should have some unique identifier for each employee record. So your new table might be called “work_weeks” and consist of something like employee_id (which matches the employee id in the current table), week_number, and hours_worked.

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

Sidebar

Related Questions

I want an array of all elements that have fixed position. This is what
In this very contrived example, I have an array with 3 elements that I'm
Closed as exact duplicate of this question . I have an array/list of elements.
I have an array of about 40-something elements that I need grouped 5 by
I have a global array containing the IDs of elements that I am currently
I have an array of elements that I need to serialize using XmlSerializer. The
I have an array that has a hierarchic structure. In this example there are
I have read this question: Deleting array elements in JavaScript - delete vs splice
I have an array of elements that I would like to apply a mapping
I have an array of CheckboxField[] elements that I need to dynamically initialize. 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.