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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:42:03+00:00 2026-05-25T21:42:03+00:00

I have a database with USERS table and EVENTS table, both with auto increment

  • 0

I have a database with USERS table and EVENTS table, both with auto increment integer primary key called id. when the client app start an event, a message sent to the server, and the server creates a new EVENT entry in the EVENTS table with the username of the user that started the event(and some more data).
now what is the best practice to refetch this event when needed?
for example if the next day the user wants to ask the server for this event should the server search the EVENT table by username(every user have only one event in the table)? If so isn’t less efficient to search by string then by the event integer id?
or maybe when the server creates the event entry in the EVENTS table i need to send the user the entry id, so the next time the user ask for the event he can ask it with the id? but if i do it this way im using the auto increment id with the business login and im not sure this is good..

  • 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-25T21:42:04+00:00Added an answer on May 25, 2026 at 9:42 pm

    You want to use a foreign key. in events with the user id

    To get the events done by a particular user, you just do

    select events.*, users.* from users left join events where users.id = events.user_id
    WHERE user.username = 'johnboy'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in MySQL with multiple of reported events (primary key, date
I have a table, users, in an Oracle 9.2.0.6 database. Two of the fields
I have a table in an Oracle database that contains actions performed by users
I have a database table that represents Events. The table has 2 main fields
I have three database tables: users emails invitations Emails are linked to users by
I have a postgres database with a user table (userid, firstname, lastname) and a
I have a user table in my mysql database that has a password column.
I have an existing database with users and administrators in different tables. I am
I have a database table where the user marks files to be downloaded. Subsequently,
I have a simple database with two tables. Users and Configurations. A user has

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.