well part of that was my fault i read what he asked wrong he asked [quote]The problem arises with having, say 10 filefields to upload to my db. I'm uploading and saving each filename with no problem, but how do I loop the filenames into the table? [/quote]
i didnt see that he had already uploaded the images ok but still...... i didnt see on there what he is doing with the db, is he making a just 1 pic field with a list of pics? or is he have a seperate field for indv pics? i dont think u can discount my code when the only code i gave was for the upload which is completely different then the code u gave, 2 completely different things. U didnt show any uploading code just how to to then take the image names and array them and insert. but where in your code do u have where u get the image names from? sure u could just have it added from the form scope but agin my piece of code does one thing and yours another so i dont see how u can take a jab like that. and yes i am not as good as u but i if he uses the way i showed the pics wou;d already be set as variables and then he could just stick the variable name right into the insert sql without going through and looping if he sets the db up to have a seperate field for each image path, if he wants them all in 1 field then your way. i dont see how that is bad code, why do the extra steps to get the same results? as far as the comments about it crashing if u have diff amount of pics? ok lets say u have 5 images and only 3 are used, i guess ur saying my code will crash? no it wont and doing it like u did, ud have to add more lines as well so whats your point? ---------- Original Message ---------------------------------- From: Joe Rinehart <[EMAIL PROTECTED]> Reply-To: cf-talk@houseoffusion.com Date: Wed, 12 Jan 2005 08:18:16 -0500 >> well then u copy and paste & change the #'s >> accordingly to accomidate how ever many images u want. >> and say that u have 5 images but that clothes line only >> has 3 pic then it will accept the 3 and ignore the other >> 2 empty fields > >That's just not a very good approach, and the point of this thread was >to do things the "right" way. Arrays and structures exists so that >you don't have to do things like this, and there's no sense using a >relational database in the nonrelational manner this method >encourages. > >It's a lot cooler to be able to say "I can change the number of images >you can add by changing a configuration file" than to have to say "I >have to change code for that." In a lot of development shops, your >method wouldn't fly at all, and would be quickly replaced. > >-Joe > >-- >For Tabs, Trees, and more, use the jComponents: >http://clearsoftware.net/client/jComponents.cfm > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:190136 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