Re: How to add images to my db the *right* way?

2005-01-12 Thread Will Tomlinson
Dude, I think I got it SPANKED!! What I've done here is a JOKE!! Just working now on the outside to make sure my queries and such will work. It all appears a ok! I only had time to work with uploading one image last night, but this evening I'm going to build an array of images and

Re: How to add images to my db the *right* way?

2005-01-12 Thread Joe Rinehart
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

Re: How to add images to my db the *right* way?

2005-01-12 Thread Scott Stroz
I have to agree with Joe. The first method suggested seems kind of amateur-ish. If there will not always be 3 images, then this method is definitley NOT the 'right' way'. Why create a dynamic application the uses static values like this? On Wed, 12 Jan 2005 08:18:16 -0500, Joe Rinehart [EMAIL

Re: How to add images to my db the *right* way?

2005-01-12 Thread dave
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

Re: How to add images to my db the *right* way?

2005-01-12 Thread dave
thats cool personally i just wouldnt go through the extra trouble of it. the way i do it is have a seperate field for each pic like (pic1, pic2, pic3) and not just 1, the reason is that most are real estate sites and i want to do diff things with diff pic at diff times and it works better for me

Re: How to add images to my db the *right* way?

2005-01-12 Thread dave
[quote]I have to agree with Joe. The first method suggested seems kind of amateur-ish. If there will not always be 3 images, then this method is definitley NOT the 'right' way'. Why create a dynamic application the uses static values like this? [/quote] what the hell are u talking about? u say

Re: How to add images to my db the *right* way?

2005-01-12 Thread dave
ok why dont we start from the beginning if he wants to learn looping and arrays then he probabaly wants to do a loop over cffile code and set the array as it goes if we all get on same page maybe we'll get a good answer to the whole deal and actually this would be good for quite a few ppl i

RE: How to add images to my db the *right* way?

2005-01-12 Thread Steve Brownlee
[quote] im no pro [/quote] Isn't that the definition of an amateur? Anyway, I think static was the wrong word for what he was trying to say. Perhaps a better way of saying that is that your code isn't very flixible nor does it scale with the application. Any time the required number of images

RE: How to add images to my db the *right* way?

2005-01-12 Thread dave
would u please actually look at the 2 sets of code before making such statements! joes code does one thing mine does another matter of fact u can take what mine does get the info then run joes to do the insert. i didnt put in anything that deals with inserting into a db and he didnt add

Re: How to add images to my db the *right* way?

2005-01-12 Thread Joe Rinehart
Hey Dave, The root of our differences here is that we're designing the application differently - it affects both the upload and the insert, and the same logic I used in my insert can (and, imho, should) be used in the upload portion. On a really low level, your design has a table that looks like

Re: How to add images to my db the *right* way?

2005-01-12 Thread Joe Rinehart
(Part 1...my reply is too long) Hey Dave, The root of our differences here is that we're designing the application differently - it affects both the upload and the insert, and the same logic I used in my insert can (and, imho, should) be used in the upload portion. On a really low level, your

Re: How to add images to my db the *right* way?

2005-01-11 Thread Will Tomlinson
I have it all worked out now. Thanks Joe! I schema's like you said which will work ok, but she said she might want up to three images per item. No biggie, I'll just revers the relationship and drop avcolorID into tblimages via FK. It's an auto num field so I'll just have to retrieve it for the

Re: How to add images to my db the *right* way?

2005-01-11 Thread Joe Rinehart
she said she might want up to three images per item Yep, but aren't clients notorious for saying Wait, I meant five!? -joe -- For Tabs, Trees, and more, use the jComponents: http://clearsoftware.net/client/jComponents.cfm ~|

Re: How to add images to my db the *right* way?

2005-01-11 Thread Will Tomlinson
she said she might want up to three images per item Yep, but aren't clients notorious for saying Wait, I meant five!? Yes indeed! I'm going to turn this into an array, then insert it. Might need some help looping it into the table. :) I've only practiced with simple arrays, never really

Re: How to add images to my db the *right* way?

2005-01-11 Thread Joe Rinehart
cfset ImageArray = arrayNew(1) / cfset ImageArray[1] = someGif.gif / cfset ImageArray[2] = someJpg.jpg / cfloop from=1 to=#arrayLen(ImageArray)# index=i cfquery datasource=#dsn# INSERT INTO images (filename) VALUES (cfqueryparam cfsqltype=cf_sql_varchar value=#ImageArray[i]#) /cfquery /cfloop

Re: How to add images to my db the *right* way?

2005-01-11 Thread dave
u dont need to loop just check to see if the file field is empty if not do the upload but be aware that u can only have 1 file.serverfile so be sure to set it before moving on to next one !--- do the file 1 upload now --- cfif #form.picture1# NEQ cffile Action=upload

Re: How to add images to my db the *right* way?

2005-01-11 Thread Will Tomlinson
cfset ImageArray = arrayNew(1) / cfset ImageArray[1] = someGif.gif / cfset ImageArray[2] = someJpg.jpg / cfloop from=1 to=#arrayLen(ImageArray)# index=i cfquery datasource=#dsn# INSERT INTO images (filename) VALUES (cfqueryparam cfsqltype=cf_sql_varchar value=#ImageArray[i]#) /cfquery /cfloop

Re: How to add images to my db the *right* way?

2005-01-11 Thread Will Tomlinson
K dave, gotcha. Workin on it now. Thanks! ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message:

Re: How to add images to my db the *right* way?

2005-01-11 Thread Joe Rinehart
When it changes from 3 images to 5, this will break. -Joe On Tue, 11 Jan 2005 15:51:35 -0500, dave [EMAIL PROTECTED] wrote: u dont need to loop just check to see if the file field is empty if not do the upload but be aware that u can only have 1 file.serverfile so be sure to set it before

Re: How to add images to my db the *right* way?

2005-01-11 Thread dave
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 i actually pulled those out of a real estate app that has 5 images, i

Re: How to add images to my db the *right* way?

2005-01-11 Thread Will Tomlinson
Got it mostly workin now fellas. Just workin on the outside to make sure my queries work ok. Thanks! Will ~| Find out how CFTicket can increase your company's customer support efficiency by 100%

Re: How to add images to my db the *right* way?

2005-01-11 Thread dave
did u get it .net boy;) i can give ya s'more code if u having probs -- Original Message -- From: Will Tomlinson [EMAIL PROTECTED] Reply-To: cf-talk@houseoffusion.com Date: Tue, 11 Jan 2005 21:25:15 -0400 Got it mostly workin now fellas. Just workin on

Re: How to add images to my db the *right* way?

2005-01-10 Thread Donna French
Hey Will - I'm going to give you a little H$LL here on the list - all in good humor of course - and only because you and I have chatted off list. But that code you posted sure looks a lot like CF and not .NET. LMAO I love ya, but I had to do it. Shoot me, sue me, whatever, it's Monday from

Re: How to add images to my db the *right* way?

2005-01-10 Thread Will Tomlinson
I love ya, but I had to do it. Shoot me, sue me, whatever, it's Monday from hell here and I could NOT pass it up! BANG BANG!!! :) Waiting for dave to roll in and finish me off now. ~| Find out how CFTicket can increase

Re: How to add images to my db the *right* way?

2005-01-10 Thread dave
lol im trying to be good remember? but u set yourself up 4 it! badly!! ok, i didnt read some of the posts but what i did read didnt make sense. u had a seperate table for colors? and r u putting the images into the db or just the paths? im making a ecomm clothes site as well, even though it

Re: How to add images to my db the *right* way?

2005-01-10 Thread Will Tomlinson
lol im trying to be good remember? but u set yourself up 4 it! badly!! I know! I know! ok, i didnt read some of the posts but what i did read didnt make sense. u had a seperate table for colors? and r u putting the images into the db or just the paths? When it comes to colors, I have

Re: How to add images to my db the *right* way?

2005-01-10 Thread dave
lol, did i really say that?? sorry bout that, get carried away sometimes! but once u excape the horrid grasp of ms u will be amazed how easy it is to validate!! (no joke and in all seriousness) ok, i dont have a ton of time to look over the stuff yet, i have a cf usergroup meeting in a bit but

Re: How to add images to my db the *right* way?

2005-01-10 Thread Will Tomlinson
Just have a look at my schema whenever you get the time. It has most of what you're talking about. I appreciate it. Will ~| Find out how CFTicket can increase your company's customer support efficiency by 100%

Re: How to add images to my db the *right* way?

2005-01-10 Thread Joe Rinehart
Hey Will, You may want to think about rearranging some of your schema: anytime you hit a situation where you wind up with column names like prodMainImage1, prodMainImage2, etc., you've found a place where you may want to examine what you're doing more closely. Personally, I'd completely nix the

Re: How to add images to my db the *right* way?

2005-01-10 Thread Will Tomlinson
Hey Will, You may want to think about rearranging some of your schema: anytime you hit a situation where you wind up with column names like prodMainImage1, prodMainImage2, etc., you've found a place where you may want to examine what you're doing more closely. Personally, I'd completely nix the

Re: How to add images to my db the *right* way?

2005-01-10 Thread Will Tomlinson
Personally, I'd completely nix the prodMainImage1, prodMainImage2 approach in the tblproductimages table, and let one row in that table represent one image. Then, I'd add a prodImageID column to the tblAvailableColors table that indicated what images were pictures of a product in a given color.