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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:26:51+00:00 2026-06-07T18:26:51+00:00

I have a query here pulling data from MySQL database. It’s working great.But what

  • 0

I have a query here pulling data from MySQL database. It’s working great.But what am trying to do is save all the data pulled from the module table into another table. How could I go about this please ?? Any help would be appreciated. Thanks.

$coremoduleY1Query = "SELECT ID,title,credits FROM module WHERE ID = 'CS1101'
            UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1105'
            UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1106'
            UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1107'
            UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1108'
            UNION SELECT ID,title,credits FROM module WHERE ID = 'CS1109'";                                                                           


        $coremoduleY1Result = mysql_query($coremoduleY1Query);
        echo "<B> Core Modules </B>";                      
        while ($coremoduleRow = mysql_fetch_array($coremoduleY1Result)) {

                 $id = htmlentities($coremoduleRow['ID']);
                 $title = htmlentities($coremoduleRow['title']);
                 $credits = $coremoduleRow['credits'];

                 echo "<ul>" . $id . " " . $title .  " " . $credits . "</ul>";
       }   
       echo "<br />";
  • 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-07T18:26:53+00:00Added an answer on June 7, 2026 at 6:26 pm

    For one why are you not querying like this:

    SELECT ID,title,credits FROM module WHERE ID IN ('CS1101','CS1105','CS1106','CS1107','CS1108','CS1109')
    

    And secondly you can do what you want totally in MySQL:

    INSERT INTO other_table (ID,title,credits)
    SELECT ID,title,credits FROM module WHERE ID IN ('CS1101','CS1105','CS1106','CS1107','CS1108','CS1109')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't figure this out. I have a query pulling data from a couple
I have a query pulling from a database: List<myClass> items = new List<myClass>(from i
I have this query which works correctly in MySQL. More background on it here
We have a Union Query. Here's a basic (similar) example: SELECT a.Name, b.Info FROM
Here is the query which will get me all the contacts have HD quality
I have a problem with (for me to complicated) MySql query. Okay, here is
I am pulling some data from a mysql table via the following: $result =
Possible Duplicate: why isn't this pulling data from 7 days back? Here is what
I have a LINQ2SQL Query: //Pulling the Product_ID from the PlanMaster Table from WebEnroll
I am working on creating a form which pulls data from a database, and

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.