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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:52:19+00:00 2026-05-31T11:52:19+00:00

Here’s my problem… I am making a client managing interface that saves values to

  • 0

Here’s my problem…
I am making a client managing interface that saves values to SQL
I am using SQL/PHP/HTML/JQUERY/CSS etc…

Everything is ok when i all the information are entered once for each client.
ie. each client has 1 or 2 phone numbers, one address, etc.

The problem appears when i want to store say multiple receipt numbers of a client.
Or ie. multiple orders of the same client.

I could start with one but through time i might need to store 100.

What is the best practice to do this?

I thought of storing the ID’s separated by commas in a single text record in SQL
Then retrieve the values, separate them and serve them.

What is the best way to do such thing?
Also, how can i command SQL to add a value to the end of the existing string instead of updating it?
Can i automatically add a column to sql each time a similar record is needed?

  • 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-31T11:52:21+00:00Added an answer on May 31, 2026 at 11:52 am

    You could save it as comma separated values but this is very bad practise and ultimately becomes a pain to maintain.

    What you need to have here is SQL normalisation.

    For example, in the case of Receipts you have two tables, one for the customer, with a unique id field, and one for receipt which has two columns, customer Id and Receipt Number, so a table for your Customer details:

    Customers:
    CustomerId INT
    Address TEXT
    Email TEXT
    

    And another table for receipts:

    Receipts:
    CustomerID INT
    ReceiptNum VARCHAR(9)
    

    Then to get all the Receipts for that customer,

    SELECT *
    FROM Receipts
    WHERE CustomerID = @ID
    

    And to add a new receipt:

    INSERT INTO Receipts (CustomerId, ReceiptNum)
    VALUES (@ID, @Receipt)
    

    This is a very loose description but I hope it gives you the idea of what you need to do.

    Update:

    To give you a sample of how this will look, if you have 2 customers in the Customer Table:

    CustomerId   Address  Email
    1            Here     test@test.com
    2            There    test2@test.com
    

    And customer 1 has 2 receipts, and customer 2 has 3 receipts:

    CustomerId   ReceiptNum
    1            abcdde10
    1            qwerty10
    2            1234-1234
    2            0987-0987
    2            abcd-efgh
    

    So the idea is that for each extra bit of information, you only need to add another row. That way you can have 1 bit of information for one customer, and 20 for another, but you don’t need to define 20 spare fields just in case.

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

Sidebar

Related Questions

Here's a coding problem for those that like this kind of thing. Let's see
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the
Here is another spoj problem that asks how to find the number of distinct
Here is my problem...I have a page that loads a list of clients and
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is the scenario: I'm writing an app that will watch for any changes
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE

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.