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

  • Home
  • SEARCH
  • 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 878905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:50:27+00:00 2026-05-15T11:50:27+00:00

I’m currently coding a product which will have only one database but will host

  • 0

I’m currently coding a product which will have only one database but will host many clients by using a global identifier of a customer_id.

This is all very good.

However, let’s say we have a table called Ticket. Idea has a primary key. When a user adds a ticket, the ticket will correspond to the customer via a foreign key etc.

However, for each customer I want their ticket ids to start from 1 when they sign up.

i.e. customer 1 adds 4 tickets, the ticket_id count will be 4. Customer 2 signs up, they add a ticket and then the ticket_id will be 5 and so on and so forth. Which is not ideal.

My question to you is, how do I get around this if I don’t want to use multiple databases? The idea of having to update tend, if hundreds of databases with new columns, indexes etc. whenever I make a change would irritate me hugely.

Hope this makes sense and I look forward to your input.

EDIT: Tagged as symfony as I will be using Doctrine ORM in symfony to manage the database…. probably irrelevant, but added just in case.

EDIT: I might also be being stupid and missing something obvious here, so my apologies.

  • 1 1 Answer
  • 1 View
  • 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-15T11:50:27+00:00Added an answer on May 15, 2026 at 11:50 am

    Am I to understand that each client will have their tickets listed sequentially from 1 onwards? I will assume that each client has his own tickets, and these are not exposed to other clients. You should clarify this in your question.

    I would suggest creating a new column in your ticket table to use as a reference number (lets call it ref_num). When client 2 creates a ticket, the ticket_id will be 5, but your application will know to assign the ref_num to 1 for that user.

    In order for that to work properly, you will need to find a way to track the number of tickets created by each client. Perhaps for each contact you could have a column called ticket_count that increments by one each time. That way, from within your application, you can just pull this number and increment it by one to update your count and get the new ticket number.

    FYI, over here we do not worry about hiding information from the user. We use a ref_num field to hide true ID numbers from the users. We have multiple departments, each of which have multiple clients, that share the same ID pool. If Group A creates ticket 23456 then group B creates another ticket, it appears as 23457 despite the fact that the previous ticket did not belong to them. The ticket number does not need to be sequential.

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I'm making a simple page using Google Maps API 3. My first. One marker

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.