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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:41:04+00:00 2026-05-13T01:41:04+00:00

I have a question I’m trying to have the q_id column take the value

  • 0

I have a question I’m trying to have the q_id column take the value of the id column when a tag is submitted I have been trying to do this using PHP but I was thinking should I just add AUTO INCREMENT to the q_id column since but tables are updated when the tag is submited. or is this the wrong way to do it or is there a better way to do this?

Here is the MySQL tables below.

CREATE TABLE q_tags (
q_id INT UNSIGNED NOT NULL,
users_q_id INT UNSIGNED NOT NULL
);

CREATE TABLE tags (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
tag VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
);  
  • 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-13T01:41:05+00:00Added an answer on May 13, 2026 at 1:41 am

    AUTO INCREMENT is used mainly to avoid adding the same ID into a table, so that you can keep a loyal index. I’d suggest you add a primary key to the q_tags, and change the current q_id to a foreign key, so that it can become a reference to tags table.

    EDIT :

    CREATE TABLE q_tags (
    q_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    t_id INT UNSIGNED NOT NULL,
    users_q_id INT UNSIGNED NOT NULL,
    PRIMARY KEY (q_id)
    );
    
    CREATE TABLE tags (
    id INT UNSIGNED NOT NULL AUTO_INCREMENT,
    tag VARCHAR(255) NOT NULL,
    PRIMARY KEY (id)
    );
    

    t_id in the first table is the “foreign key”. You can add it as a real mysql foreign key or just keep it this way (if you’re planning on be able to “cascade delete” tags and t_tags related, it would matter)

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

Sidebar

Related Questions

I have question with this same title here but now as I'll present in
I have just started using maven and have question. My pom.xml contains tag developer
i have question about finding maximum x or y-value in text file. This is
I have a question related to this one . I don't want to do
I have question regarding shared memory segmentation in c using POSIX system calls. Is
I have question about integrate Open office with PHP. I want make mail merge
I have question I'm developing small application to desktop in win Forms. I'm using
I have question regarding polymorphism about its assignment statement, for Example this is The
I have a question regarding inheritance in Java. If I have this base class
ok i have question, i made this code to play axmediaplayer base on item

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.