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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:18:16+00:00 2026-06-01T13:18:16+00:00

I currently have a table called paper , which holds all the information for

  • 0

I currently have a table called paper, which holds all the information for each paper that a user uploads to my system. I also have a table called paper_topics; this is meant to hold the paper_id and its topic_id from a table called topic. However I’m not sure how I can use PHP to allow the user to select multiple topics and then submit them along with the paper_id to the paper_topics table.

Here is the code I have for uploading the paper.

if(!is_dir("paper")) {
mkdir("paper");

}
function savedata(){
    global $_FILES, $_POST, $putItAt;
    $sql = "INSERT INTO `internetcoursework`.`paper` (
    `paper_id`, 
    `username`,
    `title`, 
    `abstract`, 
    `filelocation`, 
    `date_added`) 
    VALUES (NULL,'".mysql_real_escape_string($_POST['username'])."' , '".mysql_real_escape_string($_POST['title'])."',
    '".mysql_real_escape_string($_POST['abstract'])."', '".mysql_real_escape_string($putItAt)."', CURDATE());";
    mysql_query($sql);

    }
$putItAt = "paper/".basename($_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FIleS['uploadedfile']['tmp_name'],$putItAt)) {
savedata();
header("location: listfiles.php");
echo "you have succesfully uploaded";

}else { 
if(copy($_FILES['uploadedfile']['tmp_name'],$putItAt)) {
savedata();
    header("location: listfiles.php");
    } else {
        echo "you totally failed";

        }
        }


?>
'
  • 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-01T13:18:18+00:00Added an answer on June 1, 2026 at 1:18 pm

    If I understand your request correctly (“select multiple topics and then submit them along with the paper_id to the paper_topics table”) the basic idea is to add a multi select form element to your form (like this http://onlinetools.org/tricks/using_multiple_select.php), then use that posted value to insert rows into the paper_topics table. You’ll need to insert the paper and get the paper id first ( http://php.net/manual/en/function.mysql-insert-id.php )

    Does that answer your question?

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

Sidebar

Related Questions

I currently have a table called User which has a id column which is
I have a table called Classes which stores information on College classes. It has
I have a table called users which currently contains column money of type integer
I have a webapp that currently stores all of a user's searches into a
I currently have a table structure that looks something like this(some details omitted): ColumnName
I currently have a table which only has a single editable column. I have
I currently have a table with an id column that is being autoincremented and
I'm trying to normalize a mysql database.... I currently have a table that contains
Currently we have a table that we use to track inivitations. We have an
Currently I have a table that I search upon 4 fields, FirstName, LastName, MiddleName,

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.