RE: need insert help please
I got it, or at least it did what I've been trying to get it to do ;) May not be elegant but it worked For some reason it didn't like #form.week_of# so I tried this and it worked INSERT INTO current_week (week_of,song_title) VALUES ('#thisWeek#','#item#') Thanks for your patience and feedback Dave! It is much appreciated! Bob -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Saturday, March 10, 2007 8:03 PM To: CF-Talk Subject: RE: need insert help please > > I am passing this to: > > > name="current_week" datasource="#dsdata#" username="myname" > > password="mypwd"> > > INSERT INTO current_week (song_title) VALUES ('#item#') > > > > I'm not seeing where to shoe-horn the week_of value into the above > loop, there may be 5 or 6 song_title(s) just not seeing the syntax for > it.. Is "week_of" a field in the current_week table? If so, you can add it to that INSERT statement. If it's a field in another table, and you want to update the value, put another query outside your CFLOOP to do this. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2. Free Trial http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272299 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: need insert help please
> > I am passing this to: > > > name="current_week" datasource="#dsdata#" username="myname" > > password="mypwd"> > > INSERT INTO current_week (song_title) > > VALUES ('#item#') > > > > > > I'm not seeing where to shoe-horn the week_of value into the > above loop, there may be 5 or 6 song_title(s) just not seeing > the syntax for it.. Is "week_of" a field in the current_week table? If so, you can add it to that INSERT statement. If it's a field in another table, and you want to update the value, put another query outside your CFLOOP to do this. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272298 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: need insert help please
This was copied from a separate display page I setup for band members to download their songs from, just hadn't pulled out the link refs yet. This isn't for the public, actually it's for members of a worship band from church...to make It a little easier for folks to get to their material for the coming week. This will be displayed on another page, probably only 5 or 6 as opposed to 150+ on my archive page, so the whole week_of thing comes into play there, displaying songs for that date..yada yada yada. This is a bit off your point, but why do you have links in there? If someone clicks on one of the links, they'll leave your form without finishing it. > I am passing this to: > name="current_week" datasource="#dsdata#" username="myname" > password="mypwd"> > INSERT INTO current_week (song_title) > VALUES ('#item#') > > I'm not seeing where to shoe-horn the week_of value into the above loop, there may be 5 or 6 song_title(s) just not seeing the syntax for it.. Thanks Dave.wellat least I survived the 60s. Which may explain some of my difficulty here ;) I'm not sure what you're doing with "week_of", but it doesn't matter whether the field is inside or outside your loop if you only want it to have one value. In your action page, you'll have "week_of" along with "songTitle". Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272297 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: need insert help please
> Dave...sorry for the lack of information, after read what I > posted I thought I should have given a little more > information. My form looks like this: > > method="post"> > > > This is generated from doing a read with cfdirectory query="songs"> #name# type="checkbox" > name="songTitle" value="#name#" /> > > /> This is a bit off your point, but why do you have links in there? If someone clicks on one of the links, they'll leave your form without finishing it. > I am passing this to: > name="current_week" datasource="#dsdata#" username="myname" > password="mypwd"> > INSERT INTO current_week (song_title) > VALUES ('#item#') > > > > Working with mysql, song_id(pk) week_of, song_title and > doc_title are all 3 varchars, I hope this enough information > to get a better understanding of what I'm trying to do. In > addition to the form above, I also have a second form setup > the same way for the accompanying docs, this also built from > a cfdirectory read. I guess my main question is, since the > week_of field in my form is outside the loop, how do I handle > that value? I sure hope this is making sense to someone ;) I'm not sure what you're doing with "week_of", but it doesn't matter whether the field is inside or outside your loop if you only want it to have one value. In your action page, you'll have "week_of" along with "songTitle". Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| ColdFusion MX7 and Flex 2 Build sales & marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272294 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: need insert help please
Dave...sorry for the lack of information, after read what I posted I thought I should have given a little more information. My form looks like this: This is generated from doing a read with cfdirectory #name# I am passing this to: INSERT INTO current_week (song_title) VALUES ('#item#') Working with mysql, song_id(pk) week_of, song_title and doc_title are all 3 varchars, I hope this enough information to get a better understanding of what I'm trying to do. In addition to the form above, I also have a second form setup the same way for the accompanying docs, this also built from a cfdirectory read. I guess my main question is, since the week_of field in my form is outside the loop, how do I handle that value? I sure hope this is making sense to someone ;) Thanks ...Bob What exactly do you mean by a group of songs? More information about your form and database schema would be helpful here. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272291 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: need insert help please
> First off...shouldn't you all be out doing something other > than working? ;-) Since you're not out somewhere having way > too much fun, I could use some enlightenment here. > I have a form passing multiple values via some checkboxes, I > think I've got the insert down ok for that with the > following: I'm working with MySql and the week_of field I > have set to unique in the db. > > >password="mypwd"> >INSERT INTO current_week (song_title) >VALUES ('#item#') > > > > My question comes in with a form field that only needs to be > inserted once for each group of songs, this value is also > being passed via the form, how would I go about handling > this? To muddy this up a tad more, I have a second for that > handles song docs that need to be inserted and associated > with the week_of insert from the first insert statement. Any > help would of course be greatly appreciated! I work alone so > my only source for feedback/help/direction is this and a few > other lists. What exactly do you mean by a group of songs? More information about your form and database schema would be helpful here. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2. Free Trial http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272287 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: need insert help please
Well not sure I understand the first part, but if you have a form that passes a LIST of song titles via list element to the action page You can check the DB prior to doing the insert to check if it exists or not. --- Form Action -- ... Select ID from current_week where song_title eq '#item#' -Original Message- From: Bob Imperial [mailto:[EMAIL PROTECTED] Sent: Saturday, March 10, 2007 6:00 PM To: CF-Talk Subject: need insert help please First off...shouldn't you all be out doing something other than working? ;-) Since you're not out somewhere having way too much fun, I could use some enlightenment here. I have a form passing multiple values via some checkboxes, I think I've got the insert down ok for that with the following: I'm working with MySql and the week_of field I have set to unique in the db. INSERT INTO current_week (song_title) VALUES ('#item#') My question comes in with a form field that only needs to be inserted once for each group of songs, this value is also being passed via the form, how would I go about handling this? To muddy this up a tad more, I have a second for that handles song docs that need to be inserted and associated with the week_of insert from the first insert statement. Any help would of course be greatly appreciated! I work alone so my only source for feedback/help/direction is this and a few other lists. Thanks! Bob ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272286 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
need insert help please
First off...shouldn't you all be out doing something other than working? ;-) Since you're not out somewhere having way too much fun, I could use some enlightenment here. I have a form passing multiple values via some checkboxes, I think I've got the insert down ok for that with the following: I'm working with MySql and the week_of field I have set to unique in the db. INSERT INTO current_week (song_title) VALUES ('#item#') My question comes in with a form field that only needs to be inserted once for each group of songs, this value is also being passed via the form, how would I go about handling this? To muddy this up a tad more, I have a second for that handles song docs that need to be inserted and associated with the week_of insert from the first insert statement. Any help would of course be greatly appreciated! I work alone so my only source for feedback/help/direction is this and a few other lists. Thanks! Bob ~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272284 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4