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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:23:21+00:00 2026-06-17T19:23:21+00:00

I have new table in database to track tags, like so: TAG NAME |

  • 0

I have new table in database to track tags, like so:

    TAG NAME | IMAGE ID 

    funny       570
    funny       571
    dog         649

and I have old table to track tags, like so:

TAG ID | TAG NAME | IMAGES IDS

11       funny       570,571,572,573,574,575,576,577,578,579,580,581,58...
12       dog         649,650,651,652,653,654,655,656,657,658,659,660,66...
13       cat         844,845,846,847,848,849,850,851,852,853,854,855,85...

I need to add all the old image IDs / associated tags to new table

  • 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-17T19:23:22+00:00Added an answer on June 17, 2026 at 7:23 pm

    If i am not wrong you want to add old table record to new table.

    So all you need to do is query old table and explode imgid and loop through exploded string and add it in new table.

    Sample Code.

    <?php
    
        $query = mysqli_query("SELECT * FROM oldTable")or die(mysqli_error());
        while($row = mysql_fetch_assoc($query))
        {
            $ids = explode(",",$row['imageID']);
    
            foreach($ids as $newImgId)
            {
                $Insert_query = mysqli_query("INSERT INTO NEWTABLE ('tagname','img_id') VALUES ('".$row['tag']."','".$newImgId."')")or die(mysqli_error());
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a person table in a database. Whenever a new person is
I have an a new table with the column below: id , name ,
Hi all! I have a database table that looks somewhat like this (stripped for
I have a new clustered database and I've been moving data into the tables
I have created a new table including a column note. The default is varchar(255)
I have the following code which creates a new table. var html = '<table>';
Most of my content is in a new table I have added to JOOMLA
say I have a UITableView and upon selecting a new table row (thus firing
I have a html table and insert a new row with table.insertRow() , but
I have a table into which new data is frequently inserted. I need to

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.