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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:19:26+00:00 2026-05-16T15:19:26+00:00

I’m designing a database in MySQL and PHP for a basic CMS. The CMS

  • 0

I’m designing a database in MySQL and PHP for a basic CMS. The CMS will have a front end which will allow sorting and searching. The backend will allow authorized users to upload files.

I’m using PHPMyAdmin and I’d like help setting up my database.

I am open to answers explaining various MySQL datatypes and what they are good for as well . Use common database fields as examples please.

Below is a list of what I’d like. What’s missing and what datatypes do I need to use?

Resources (For my files)

  • file_id
  • filename (Files are presorted and display names and paths are derived
    from here.)
  • file_type (PDF | AUDIO | VIDEO | PHOTO [Also used to generate file
    urls])
  • upload date (timestamp in PHP or MySQL)
  • uploaded_by (User ID from Users table)
  • event (event_id from Events table, optional)

Users (User accounts – for admin access and maybe a notification list)

  • user_id
  • first_name
  • last_name
  • email
  • password
  • phone_number (optional)
  • permissions_level (read only, upload)
  • creation_date

Events

  • event_id
  • event_name
  • event_location
  • event_date
  • event_description
  • entry_date
  • 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-16T15:19:27+00:00Added an answer on May 16, 2026 at 3:19 pm

    What I would take:

    Resources (For my files)

    • file_id INT (or SMALLINT depending on the number of expected entries)
    • filename VARCHAR (or text if longer than 255 chars)
    • file_type ENUM (if only those you mentioned or VARCHAR if dynamic types can be added)
    • upload DATE DATETIME (or DATE if you don’t need the time)
    • uploaded_by INT (or SMALLINT but the same as in the user table)
    • event INT (or SMALLINT but the same as in the event table)

    Users (User accounts – for admin access and maybe a notification list)

    • user_id INT (or SMALLINT depending on the number of expected entries)
    • first_name VARCHAR
    • last_name VARCHAR
    • email VARCHAR
    • password CHAR(40) (for a SHA1 hash)
    • phone_number VARCHAR (as it might contain something like -, / or +)
    • permissions_level TINYINT (if only number values and at most 127 values)
    • creation_DATE DATETIME (or DATE if you don’t need the time)

    Events

    • event_id INT (or SMALLINT depending on the number of expected entries)
    • event_name VARCHAR
    • event_location VARCHAR
    • event_DATE DATETIME (or DATE if you don’t need the time)
    • event_description TEXT (as 255 of VARCHAR might be to short)
    • entry_DATE DATETIME (or DATE if you don’t need the time)

    When you have set up your database and input some dummy data, you can run a simple statement through phpmyadmin that will tell you, what MySQL would take for that exact dummy data:

    SELECT * FROM events PROCEDURE ANALYSE()
    

    In the column Optimal_fieldtype you will find what MySQL tells you to take. But you should not take that exact fieldtype. It will tell you very often to take a ENUM but most of the time you add random data so you have to take a VARCHAR in that cases the column Max_length will give you a hint on how long it should be. But on all VARCHAR fields you should add additonal space depending on how long you expect the values to be. Take in consideration that even a name can be longer than 50 chars.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a text area in my form which accepts all possible characters from
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 have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.