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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:00:02+00:00 2026-06-05T04:00:02+00:00

I have a form where I am trying to implement a tag system. It

  • 0

I have a form where I am trying to implement a tag system.

It is just an:

<input type="text"/> 

with values separated by commas.

e.g. "John,Mary,Ben,Steven,George"

(The list can be as long as the user wants it to be.)

I want to take that list and insert it into my database as an array (where users can add more tags later if they want). I suppose it doesn’t have to be an array, that is just what seems will work best.

So, my question is how to take that list, turn it into an array, echo the array (values separated by commas), add more values later, and make the array searchable for other users. I know this question seems elementary, but no matter how much reading I do, I just can’t seem to wrap my brain around how it all works. Once I think I have it figured out, something goes wrong. A simple example would be really appreciated. Thanks!

Here’s what I got so far:

$DBCONNECT
$artisttags = $info['artisttags'];
$full_name = $info['full_name'];
$tel = $info['tel'];
$mainint = $info['maininst'];
if(isset($_POST['submit'])) {
  $tags = $_POST['tags'];
  if($artisttags == NULL) {
    $artisttagsarray = array($full_name, $tel, $maininst);
    array_push($artisttagsarray,$tags);
    mysql_query("UPDATE users SET artisttags='$artisttagsarray' WHERE id='$id'");
    print_r($artisttagsarray); //to see if I did it right
    die();
  } else {
    array_push($artisttags,$tags);  
    mysql_query("UPDATE users SET artisttags='$artisttags' WHERE id='$id'");
    echo $tags;
    echo " <br/>";
    echo $artisttags;
    die();
    }
}
  • 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-05T04:00:05+00:00Added an answer on June 5, 2026 at 4:00 am

    Create a new table, let’s call it “tags”:

    tags
    - userid
    - artisttag
    

    Each user may have multiple rows in this table (with one different tag on each row). When querying you use a JOIN operation to combine the two tables. For example:

    SELECT username, artisttag
    FROM users, tags
    WHERE users.userid = tags.userid
    AND   users.userid = 4711
    

    This will give you all information about the user with id 4711.

    Relational database systems are built for this type of work so it will not waste space and performance. In fact, this is the optimal way of doing it if you want to be able to search the tags.

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

Sidebar

Related Questions

i have this form and im trying to get the value from the text
I have a form with multiple dropdowns consisting of multiple values. I'm trying to
I have a WPF form where I'm trying to make a simple input form.
I am trying to implement an SWFUpload on a form I have. However, it
I have a multi-page form, and I'm trying to implement Back buttons, so that
I have a VB Solution with a dozen forms trying to implement invoice system.
I have a multi page form that I am trying to implement on my
I'm trying to implement master detail in a rails form with fields_for. I have
I have a form I'm trying to do validation on. Requirements state that underscore
I have a form that is trying to insert some data into an SQL

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.