and thats why i transactionalized that puppy, so that no other
insert statements could generate that same identity when setting
the value of it.

tw

-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2003 10:49 PM
To: CF-Talk
Subject: RE: a naming '#CFFILE.ServerFile#' question


thats what select @@identity does fer ya homey.
that gets you the id of the last inserted listing...

in the first query make no mention of pictures.

just insert the basic property data, then do the other
stuff i sent.

tw

-----Original Message-----
From: Dave Lyons [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2003 10:47 PM
To: CF-Talk
Subject: Re: a naming '#CFFILE.ServerFile#' question


the problem with that is that you wont know the listing # until after
the
files are uploaded and the db insert has started & this comes before the
insert. I better go sit on da throne 4 awhile & think about it;)


----- Original Message -----
From: "Tony Weeg" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, June 02, 2003 10:34 PM
Subject: RE: a naming '#CFFILE.ServerFile#' question


> ok.
>
> i didnt read the ENTIRE thing, but i think its still possible.
> let me try...
>
> do 1 query to get the data about the property in the db
>
> <cftransaction>
>
> <cfquery>
> first query stuff here.
> </cfquery>
>
> <cfquery name="getlistingId">
> select @@Identity from listings
> </cfquery>
>
> <cfset thisListingId = getlistingId.id>
>
> </cftransaction>
>
>
> <cfset imagesToUpload=ArrayNew(1)>
>
> <cfloop index="i" list="imageformFields">
>
> <!--- do the file 1 upload now --->
> <cfif #form.picture1# NEQ "">
> <cffile Action="upload"
> Filefield="picture1"
> DESTINATION="#UPpath#"
> Nameconflict="makeunique" accept="image/*">
> </cfif>
>
> <cfquery>
> update listings set picture#i# = '#CFFILE.ServerFile#'
> where id = #thisListingId#
> </cfquery>
>
> </cfloop>
>
> that will loop as many times as there are imageFormFields, and just do
> them
> in order?
>
> tony
>
> -----Original Message-----
> From: Dave Lyons [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 02, 2003 10:23 PM
> To: CF-Talk
> Subject: Re: a naming '#CFFILE.ServerFile#' question
>
>
> thanks a hole;)
> ur always starting something arent u! haha
>
> so to your reply
> "huh?" lol
>
> either way dont i still have to name the cffile.serverfile something
> different for each 1?
>
> ----- Original Message -----
> From: "Tony Weeg" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Monday, June 02, 2003 10:09 PM
> Subject: RE: a naming '#CFFILE.ServerFile#' question
>
>
> > dave.
> >
> > get some count of the files that you are uploading,then do a loop
> > use the index var to give it a new iteration number, then make an
> > array of them, you will have sequential names....and from there
> > you can access them by their position in the array.
> >
> > :) tony (the arseholio)
> >
> > -----Original Message-----
> > From: Dave Lyons [mailto:[EMAIL PROTECTED]
> > Sent: Monday, June 02, 2003 10:03 PM
> > To: CF-Talk
> > Subject: a naming '#CFFILE.ServerFile#' question
> >
> >
> > i have this multiple file upload wich is all fine except I cant
quite
> > figure out what to name the 5 different '#CFFILE.ServerFile#'. I
know
> I
> > have scene but as usually i cant find it.
> > i put in the relevant code.
> >
> >
> >
> > <!--- do the file 1 upload now --->
> >  <cfif #form.picture1# NEQ "">
> >  <cffile Action="upload"
> >   Filefield="picture1"
> >   DESTINATION="#UPpath#"
> >   Nameconflict="makeunique" accept="image/*">
> >  </cfif>
> >
> > <!--- do the file 2 upload now --->
> >  <cfif #form.picture2# NEQ "">
> >  <cffile Action="upload"
> >   Filefield="picture2"
> >   DESTINATION="#UPpath#"
> >   Nameconflict="makeunique" accept="image/*">
> >  </cfif>
> >
> > <!--- do the file 3 upload now --->
> >  <cfif #form.picture3# NEQ "">
> >  <cffile Action="upload"
> >   Filefield="picture3"
> >   DESTINATION="#UPpath#"
> >   Nameconflict="makeunique" accept="image/*">
> >  </cfif>
> >
> > <!--- do the file 4 upload now --->
> >  <cfif #form.picture4# NEQ "">
> >  <cffile Action="upload"
> >   Filefield="picture4"
> >   DESTINATION="#UPpath#"
> >   Nameconflict="makeunique" accept="image/*">
> >  </cfif>
> >
> > <!--- do the file 5 upload now --->
> >  <cfif #form.picture5# NEQ "">
> >  <cffile Action="upload"
> >   Filefield="picture5"
> >   DESTINATION="#UPpath#"
> >   Nameconflict="makeunique" accept="image/*">
> >  </cfif>
> >
> >
> > <!--- insert the  contents of the form into the db --->
> > <cfif isdefined ("form.submit")>
> > <cfquery name="qaddlisting" datasource="#dsn#">
> >   INSERT INTO listings (mlsID, featured_listing, status, price,
type,
> > address, city, state, zip, neighborhood, complex, year, beds, baths,
> >   sqft, garage, basement, basementsqft, finished, stories, yard,
> > yardsize, view, taxes, hoa, features1, description, picture1,
> picture2,
> > picture3, picture4, picture5)
> >     VALUES ('#form.mlsID#', '#form.featured_listing#',
> '#form.status#',
> > '#form.price#', '#form.type#', '#form.address#', '#form.city#',
> > '#form.state#', '#form.zip#',
> >     '#form.neighborhood#', '#form.complex#', '#form.year#',
> > '#form.beds#', '#form.baths#', '#form.sqft#', '#form.garage#',
> > '#form.basement#', '#form.basementsqft#', '#form.finished#',
> >      '#form.stories#', '#form.yard#', '#form.yardsize#',
> '#form.view#',
> > '#form.taxes#', '#form.hoa#', '#form.features1#',
> '#form.description#',
> >     '#CFFILE.ServerFile#', '#CFFILE.ServerFile#',
> '#CFFILE.ServerFile#',
> > '#CFFILE.ServerFile#', '#CFFILE.ServerFile#')
> > </cfquery>
> > </cfif>
> >
> >
> >
> >
> >
> >
>
> 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to