Re: Joe - dave > Arrays VS. Structures?

2005-01-14 Thread Joe Rinehart
Hey Will,

Good to see you thinking dynamically!  

You actually don't need an array or a struct to do this, but I'll
write up a quick way using each.

Without array of structs:





  


   INSERT INTO files (title, filename)
   VALUES ('#form["title" & i]#', '#cffile.serverFile#')

  











If you needed to break that and store everything in an array of
structs, here's how we could do the action part:



  
  





  

  
  

   INSERT INTO files (title, filename)
   VALUES ('#uploadedFiles[i].title#', '#uploadedFiles[i].file#')

  



-Joe

On Thu, 13 Jan 2005 20:07:00 -0400, Will Tomlinson <[EMAIL PROTECTED]> wrote:
> I'm starting this thread to continue a discussion on file uploads, arrays, 
> etc..
> 
> I'm reading some on Jeff Peters book, Lists, arrays, and structures, and I'd 
> like to ask you guys what would be the best way to handle my form values, 
> looping them into a table.
> 
> Let's say I had this for a form.
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> How would I build a flexible array or structure that ArrayAppend(ed) or 
> StructAppend(ed) my items into them. Then I loop over the array or structure 
> and insert the values into my table.
> 
> What's the best method? Joe? dave? Could you provide a simple example?
> 
> Thanks,
> 
> Will
> 
> 

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190417
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Joe - dave > Arrays VS. Structures?

2005-01-13 Thread dave
yup, i called the karma police on u!

-- Original Message --
From: "Adrian Lynch" <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Fri, 14 Jan 2005 02:19:35 -

>And no sooner do I mention typos!
>
>label should be fileName and value should be titleName in the function.
>
>Right, I'm really going to bed now... Zzzz Zzzz
>Zz
>
>Ade :OD
>
>-Original Message-
>From: Adrian Lynch [mailto:[EMAIL PROTECTED]
>Sent: 14 January 2005 02:10
>To: CF-Talk
>Subject: RE: Joe - dave > Arrays VS. Structures?
>
>
>Just done something like this but for associating form labels with values.
>Seems like it's what you're after...
>
>
>   
>
>   
>   
>   
>
>StructNew()>
>ARGUMENTS.label>
>ARGUMENTS.value>
>
>   
>
>   
>
>
>...and you'd use it like this...
>
>
>   
>
>   
>
>   
>   FORM["titleName" & i])>
>   
>
>   
>   
>
>
>... and then you can get at the values like this...
>
>
>   
>
>   
>
>   #someVar[i].fileName# - #someVar[i].titleName# -
>
>   
>
>   
>
>
>... is that any good? Untested so watch out for typos/mistakes.
>
>It's gone two in the morning here, I'm away to bed, I'm kerknackered :OS
>
>Ade
>
>-Original Message-
>From: Will Tomlinson [mailto:[EMAIL PROTECTED]
>Sent: 14 January 2005 00:07
>To: CF-Talk
>Subject: Joe - dave > Arrays VS. Structures?
>
>
>I'm starting this thread to continue a discussion on file uploads, arrays,
>etc..
>
>I'm reading some on Jeff Peters book, Lists, arrays, and structures, and I'd
>like to ask you guys what would be the best way to handle my form values,
>looping them into a table.
>
>Let's say I had this for a form.
>
>
>
>
>
>
>
>
>
>
>How would I build a flexible array or structure that ArrayAppend(ed) or
>StructAppend(ed) my items into them. Then I loop over the array or structure
>and insert the values into my table.
>
>What's the best method? Joe? dave? Could you provide a simple example?
>
>Thanks,
>
>Will
>--
>No virus found in this outgoing message.
>Checked by AVG Anti-Virus.
>Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005
>
>
>
>
>

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190384
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Joe - dave > Arrays VS. Structures?

2005-01-13 Thread Adrian Lynch
And no sooner do I mention typos!

label should be fileName and value should be titleName in the function.

Right, I'm really going to bed now... Zzzz Zzzz
Zz

Ade :OD

-Original Message-
From: Adrian Lynch [mailto:[EMAIL PROTECTED]
Sent: 14 January 2005 02:10
To: CF-Talk
Subject: RE: Joe - dave > Arrays VS. Structures?


Just done something like this but for associating form labels with values.
Seems like it's what you're after...

















...and you'd use it like this...














... and then you can get at the values like this...






#someVar[i].fileName# - #someVar[i].titleName# -






... is that any good? Untested so watch out for typos/mistakes.

It's gone two in the morning here, I'm away to bed, I'm kerknackered :OS

Ade

-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED]
Sent: 14 January 2005 00:07
To: CF-Talk
Subject: Joe - dave > Arrays VS. Structures?


I'm starting this thread to continue a discussion on file uploads, arrays,
etc..

I'm reading some on Jeff Peters book, Lists, arrays, and structures, and I'd
like to ask you guys what would be the best way to handle my form values,
looping them into a table.

Let's say I had this for a form.










How would I build a flexible array or structure that ArrayAppend(ed) or
StructAppend(ed) my items into them. Then I loop over the array or structure
and insert the values into my table.

What's the best method? Joe? dave? Could you provide a simple example?

Thanks,

Will
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005




~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190365
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Joe - dave > Arrays VS. Structures?

2005-01-13 Thread Adrian Lynch
Just done something like this but for associating form labels with values.
Seems like it's what you're after...

















...and you'd use it like this...














... and then you can get at the values like this...






#someVar[i].fileName# - #someVar[i].titleName# -






... is that any good? Untested so watch out for typos/mistakes.

It's gone two in the morning here, I'm away to bed, I'm kerknackered :OS

Ade

-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED]
Sent: 14 January 2005 00:07
To: CF-Talk
Subject: Joe - dave > Arrays VS. Structures?


I'm starting this thread to continue a discussion on file uploads, arrays,
etc..

I'm reading some on Jeff Peters book, Lists, arrays, and structures, and I'd
like to ask you guys what would be the best way to handle my form values,
looping them into a table.

Let's say I had this for a form.










How would I build a flexible array or structure that ArrayAppend(ed) or
StructAppend(ed) my items into them. Then I loop over the array or structure
and insert the values into my table.

What's the best method? Joe? dave? Could you provide a simple example?

Thanks,

Will
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 12/01/2005


~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190362
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Joe - dave > Arrays VS. Structures?

2005-01-13 Thread dave
dont ask me will, im sure im doing it wrong! haha

i was thinking bout what joe said and i looked at my code and realize that i do 
things the way do out of a habit from my medical days
basically i need too see what its doing to be confident in it

good thing i dont have a "shop" to yell at me huh!



-- Original Message --
From: Will Tomlinson <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Thu, 13 Jan 2005 20:07:00 -0400

>I'm starting this thread to continue a discussion on file uploads, arrays, 
>etc..
>
>I'm reading some on Jeff Peters book, Lists, arrays, and structures, and I'd 
>like to ask you guys what would be the best way to handle my form values, 
>looping them into a table. 
>
>Let's say I had this for a form. 
>
>
>
>
>
>
>
>
>
>
>How would I build a flexible array or structure that ArrayAppend(ed) or 
>StructAppend(ed) my items into them. Then I loop over the array or structure 
>and insert the values into my table. 
>
>What's the best method? Joe? dave? Could you provide a simple example?
>
>Thanks, 
>
>Will
>
>
>
> 
>
>

~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190358
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Joe - dave > Arrays VS. Structures?

2005-01-13 Thread Will Tomlinson
I'm starting this thread to continue a discussion on file uploads, arrays, etc..

I'm reading some on Jeff Peters book, Lists, arrays, and structures, and I'd 
like to ask you guys what would be the best way to handle my form values, 
looping them into a table. 

Let's say I had this for a form. 










How would I build a flexible array or structure that ArrayAppend(ed) or 
StructAppend(ed) my items into them. Then I loop over the array or structure 
and insert the values into my table. 

What's the best method? Joe? dave? Could you provide a simple example?

Thanks, 

Will



 

~|
 Save $10 Download ZoneAlarm Security Suite 
http://www.houseoffusion.com/banners/view.cfm?bannerid=66

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190356
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54