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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:44:29+00:00 2026-06-11T19:44:29+00:00

I am creating a blog or something like email, where the user can attach

  • 0

I am creating a blog or something like email, where the user can attach files. Technically there is no limitation in how many files he can add (forget about the possibility for now). If the user have added 10 attachment, how should I manage my table to store the url path of those attachment. Should I create 20 columns in the table for saving the url path of the attachment? What if the user wants to attach more than 20 files? I am using mysql database.

  • 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-11T19:44:30+00:00Added an answer on June 11, 2026 at 7:44 pm

    This is a classic “one to many” relationship. Represent the “many” portion by a separate table, which will be a child endpoint of a foreign key whose parent endpoint is your “main” table.

    Something like this:

    CREATE TABLE EMAIL (
        EMAIL_ID INT PRIMARY KEY
        -- Other fields...
    );
    
    CREATE TABLE ATTACHMENT (
        ATTACHMENT_ID INT PRIMARY KEY,
        EMAIL_ID INT NOT NULL,
        -- ATTACHMENT_URL and other fields... 
        FOREIGN KEY (EMAIL_ID) REFERENCES EMAIL (EMAIL_ID)
    );
    

    You can now easily insert several rows into ATTACHMENT that all reference the same row from EMAIL.

    The foreign key ensures that you can’t insert an attachment for a non-existent e-mail, nor you can delete the e-mail and leave its attachments “hanging in the air”.

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

Sidebar

Related Questions

I am trying to accomplish something like this: I am creating a simple blog.
I have to do an assignment of creating a blog with users who can
I am creating a simple blog applicaton. I have to add comments to a
I am creating an online blog website and for each blog post, I'd like
Is there any opensourse, free set of components for creating Flex mxml graphs? like
I'm creating a blog engine as a learning exercise and one particular problem has
I'm creating a blog, but I need box-shadows for my boxes, so I'm asking
I am working on creating a blog with ASP.Net 4, MVC 3, Razor and
Im creating my own blog managing app in rails (for experimental purposes).... What would
I am creating a simple blog as part of a website and I am

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.