[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

insert into two tables

Posted on 2007-11-25
2
Medium Priority
?
1,877 Views
Last Modified: 2012-06-21
I'm still new at php and mysql, so hope I've given the correct info here to help you answer my question.

While the data is being added to the table using the below code, I need to also add the name and filepath date to a second table. This entry in the second table will be new entry in it. Is it possible to do this, and if so, how would I best accomplish that? I've not included the form portion of the code, but if it's needed, please let know.

if((array_search(stristr($fileName, '.'), $allowedExtensions))) {
// They are allowed to proceed with the upload
 
$query = "INSERT INTO cms_file_entries (name, CatID, file, size, type, path, Description, importance ) ".
"VALUES ('$fileName', '$CatID', '$file', '$fileSize', '$fileType', '$filePath', '$Description', '$importance')";
 
    mysql_query($query) or die('Error, query failed : ' . mysql_error());  
 
	echo "<br><strong>File uploaded</strong><br>";
 
} else {
   // They are not allowed to proceed with the upload - notify them of same
   echo "<strong>Sorry, you are not allowed to upload that sort of file.</strong>";
} // end if

Open in new window

0
Comment
Question by:nascent1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
gamebits earned 2000 total points
ID: 20347208
Just add a second insert query in the script, could be name $query2 = INSERT....
0
 

Author Closing Comment

by:nascent1
ID: 31410896
Thank you! :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question