acquiring value of primary key from uploaded file



I have a PHP file upload feature that also gives the user the option to
assign more than 1 project association to the file. The file's name, title,
primary project, etc. is inserted into a document link table in a MySQL db
after the file is uploaded. The secondary (and multiple) project(s) are also
selected using a separate list box (there are 2 boxes - one for the primary
project, and one for any/all associated projects) The selected values from
the secondary box need to be inserted into a junction table that reflects
both the id for the newly uploaded file and the secondary project(s) - with
a primary key for the association itself, i.e,:

assoc_id doc_id proj_id
1 265 5
2 265 3
3 265 1

I would use a foreach statement to pull the projects from the select list,
but how do I get the newly generated doc_id in order to pass that value to
the association table? Can I assign it a variable at the same time I insert
the data into the primary table? The ID is auto-incremented and is inserted
into the primary table as follows:

$tool_insert = "INSERT INTO tools VALUES ('', '$uploadedname', '$tooltitle',
'$tooldesc', '$tooltype_id', '$toolcat_id', '$primeproj_id', '$location')";

Thanks for any help.

Christina


.



Relevant Pages

  • Re: Upload your files from your PC using the browse button on my website
    ... Trying to read the code MS generates is harder than reading ancient runes of Incas. ... email link to send photos or files, and this is a hassle for them as ... I have tried to use the code for the file upload feature from frontpage ...
    (microsoft.public.publisher.webdesign)
  • Re: help with upload perl
    ... Lincoln starts the section "USING the File Upload Feature" by warning: ...
    (comp.lang.perl.misc)
  • Upload your files from your PC using the browse button on my website
    ... email link to send photos or files, and this is a hassle for them as ... I have tried to use the code for the file upload feature from frontpage ... I upload my website to my server using http, and my forms work great, ...
    (microsoft.public.publisher.webdesign)
  • Re: Changing folder properties in FP2002
    ... In Folder view, ... >> I am trying to set up a file upload feature to my ... >> create a new folder that the visitors will upload their ... >> in the folder properties dailog box? ...
    (microsoft.public.frontpage.programming)