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

2005-01-13 Thread Joe Rinehart
> i guess i get stuck in that because say the real estate sites get 5 
> images and thats all, so for me it was easier to do it that way 
> then be more elaborate.

Ummhow would Scott put thisEasier != Gooder.  I think you'll
find the relational way of doing much easier when it comes time to
change things or add functionality.

> now if it was for awhole company then things would change but for 
> the lil peasly one no.

That may not be an ideal way to treat your clients, much less your
applications.  Why not make something that you can sell again to a
bigger client?

> plus honestly i didnt know how looping would effect fileserver 

You'd have the same amount of cffile action="upload" calls, so it wouldn't.

> my train of thought has all the fields in 1 table & u cant effectively do 
> that 
> without setting each field if it has an entry.

I don't follow what you're saying.

> so if i was doing a real estate site i would have to have 1 form do 
> the initial property insert then go back and have another to fo the 
> images and that doesnt make any sense to me at all

Not at all.  There's no reason the form to insert the property and add
images can't all be a one shot deal.  Why do you say this?


> or i guess u could do it in 1 form but u'd have a lot more code then 
> just doing it like i did

Not really - if you explain what you mean, I'll try to post an example
of how I'd approach it.

-Joe

-- 
For Tabs, Trees, and more, use the jComponents:
http://clearsoftware.net/client/jComponents.cfm

~|
Protect Your PC from viruses, hackers, spam and more. Buy PC-cillin with Easy 
Installation & Support 
http://www.houseoffusion.com/banners/view.cfm?bannerid=61

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190203
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


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

2005-01-13 Thread Joe Rinehart
> is your idea to have the image paths stored in a diff table then 
> the rest of the product info?

If you're relating multiple images to products, and you're using a
relational database, storing images in a different table would be the
way to go.

> and then ur uploading the images and making a new record for each 
> picture and using the productID to pull them together with the record when 
> its shown?

Exactly.

> i really dont get how thats more elegant, seems more chances for it to 
> break in a few more places

It's more elegant in that it solves the problem through a scalable,
relational solution rather than a brute force, static, non-relational
manner.  It can be altered, added to, or removed without going back to
square one.


> see joe what i was doing was trying to take the looping out so that 
> there is only 1 insert and the images are stored in the same table 
> as the rest, so that way i can call them as i want without 
> having to pull outta extra tables.

Then why are we using relational databases?

-- 
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:190202
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: How to add images to my db the *right* way?

2005-01-12 Thread dave
right, i see what ur saying just the basic design is diff

i guess i get stuck in that because say the real estate sites get 5 images and 
thats all, so for me it was easier to do it that way then be more elaborate.
now if it was for awhole company then things would change but for the lil 
peasly one no.

plus honestly i didnt know how looping would effect fileserver because my train 
of thought has all the fields in 1 table & u cant effectively do that without 
setting each field if it has an entry.
so if i was doing a real estate site i would have to have 1 form do the initial 
property insert then go back and have another to fo the images and that doesnt 
make any sense to me at all
or i guess u could do it in 1 form but u'd have a lot more code then just doing 
it like i did

-- Original Message --
From: Joe Rinehart <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Wed, 12 Jan 2005 21:50:17 -0500

>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 this:
>
>tblProductImages
>-
>ProductId
>ImageFileName1
>ImageFileName2
>ImageFileName3
>
>If I understand correctly, you'd do this to handle the upload:
>
>
>
>
>
>
>
>
>
>
>And this for your insert:
>
>
>  INSERT INTO tblProductImages (ImageFileName1, ImageFileName2, ImageFileName3)
>  VALUES (...)
>
>
>And if you needed all image file names:
>
>
>  SELECT ImageFileName1, ImageFileName2, ImageFileName3
>  FROM tblProductImages
>  WHERE productId = 
>
>
>What Scott means by this being a "static" design is that the number of
>images per product supported by your application is a static value,
>unable to be changed without changing code.  Why trap yourself like
>this?  One of the reasons relational databases _exist_ is to avoid
>situations like this.
>
>This is a design that would be more of a best practice:
>
>tblProductImages
>-
>ProductId
>ImageFileName
>
>Then, in your app, have a configuration variable that stores how many
>images are allowed per product.  Let's say that's stored in a variable
>called, well, "maxProductImages".
>
>First, we put our upload and insert into one loop:
>
>
>  
>  
>INSERT INTO tblProductImages (ImageFileName)
>VALUES ('#cffile.serverfile#')
>  
>
>
>Much more streamlined, and you can just change maxProductImages
>instead copying/pasting code, introducting typos, etc.
>
>And if you needed all image file names:
>
>
>  SELECT ImageFileName
>  FROM tblProductImages
>  WHERE productId...
>
>
>Don't let your design box you in.  If you're repeating code, there's
>likely to be a better way to do it - try to find it!  Numbered
>fieldnames like "ImageFile1, ImageFile2, ImageFile3" or
>"FavoriteUrl[1-17]" should set off warning klaxons.
>
>Finding better design now also makes the future a lot less painful. 
>If your client suddenly wanted to choose a "preferred" image to show
>on the product's main page, you'd have a few different options.
>
>One would be to add a new column to tblProductImages that says which
>other column is preferred.  Yuck - you'd have to do something like two
>queries or a subquery to find out what the preferred column name was.
>
>Another would be to created a tblPreferredProductImages that kept
>track of which column currently kept track of which image is preferred
>for a given product.  Again, selects would get ugly and costly.
>
>The design I suggest, and that I think most developers would prefer,
>make it easy and elegant.  You'd just add a "Preferred" column to
>tblProductImages that was a simple bit flag, and do "SELECT
>ImageFileName FROM tblProductImages WHERE productId = #productId# AND
>Preferred = 1".  It's elegant, it's quick, and doesn't affect our
>existing design or queries in the slightest.  And yes, I skipped using
>cfqueryparam to avoid monkeying up the example.
>
>Have a good night, I've finished my beer now.
>
>-Joe
>
>-- 
>For Tabs, Trees, and more, use the jComponents:
>http://clearsoftware.net/client/jComponents.cfm
>
>

~|
Purchase Contribute 3 from House of Fusion, a Macromedia Authorized Affiliate 
and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=53

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190189
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: How to add images to my db the *right* way?

2005-01-12 Thread dave
ok are think we are on diff pages

is your idea to have the image paths stored in a diff table then the rest of 
the product info?

and then ur uploading the images and making a new record for each picture and 
using the productID to pull them together with the record when its shown?
i really dont get how thats more elegant, seems more chances for it to break in 
a few more places

see joe what i was doing was trying to take the looping out so that there is 
only 1 insert and the images are stored in the same table as the rest, so that 
way i can call them as i want without having to pull outta extra tables.

so i maight have some repeating code there but a lot less on the pulling them 
out and/or updating them

i agree it looks cooler but at least 4 me it would be a bigger pita

-- Original Message --
From: Joe Rinehart <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Wed, 12 Jan 2005 22:00:06 -0500

>(Part 2)
>
>This is a design that would be more of a best practice:
>
>tblProductImages
>-
>ProductId
>ImageFileName
>
>Then, in your app, have a configuration variable that stores how many
>images are allowed per product.  Let's say that's stored in a variable
>called, well, "maxProductImages".
>
>First, we put our upload and insert into one loop:
>
>
> 
> 
>   INSERT INTO tblProductImages (ImageFileName)
>   VALUES ('#cffile.serverfile#')
> 
>
>
>Much more streamlined, and you can just change maxProductImages
>instead copying/pasting code, introducting typos, etc.
>
>And if you needed all image file names:
>
>
> SELECT ImageFileName
> FROM tblProductImages
> WHERE productId...
>
>
>Don't let your design box you in.  If you're repeating code, there's
>likely to be a better way to do it - try to find it!  Numbered
>fieldnames like "ImageFile1, ImageFile2, ImageFile3" or
>"FavoriteUrl[1-17]" should set off warning klaxons.
>
>Finding better design now also makes the future a lot less painful.
>If your client suddenly wanted to choose a "preferred" image to show
>on the product's main page, you'd have a few different options.
>
>One would be to add a new column to tblProductImages that says which
>other column is preferred.  Yuck - you'd have to do something like two
>queries or a subquery to find out what the preferred column name was.
>
>Another would be to created a tblPreferredProductImages that kept
>track of which column currently kept track of which image is preferred
>for a given product.  Again, selects would get ugly and costly.
>
>The design I suggest, and that I think most developers would prefer,
>make it easy and elegant.  You'd just add a "Preferred" column to
>tblProductImages that was a simple bit flag, and do "SELECT
>ImageFileName FROM tblProductImages WHERE productId = #productId# AND
>Preferred = 1".  It's elegant, it's quick, and doesn't affect our
>existing design or queries in the slightest.  And yes, I skipped using
>cfqueryparam to avoid monkeying up the example.
>
>Have a good night, I've finished my beer now.
>
>-- 
>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:190188
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: How to add images to my db the *right* way?

2005-01-12 Thread Joe Rinehart
(Part 2)

This is a design that would be more of a best practice:

tblProductImages
-
ProductId
ImageFileName

Then, in your app, have a configuration variable that stores how many
images are allowed per product.  Let's say that's stored in a variable
called, well, "maxProductImages".

First, we put our upload and insert into one loop:


 
 
   INSERT INTO tblProductImages (ImageFileName)
   VALUES ('#cffile.serverfile#')
 


Much more streamlined, and you can just change maxProductImages
instead copying/pasting code, introducting typos, etc.

And if you needed all image file names:


 SELECT ImageFileName
 FROM tblProductImages
 WHERE productId...


Don't let your design box you in.  If you're repeating code, there's
likely to be a better way to do it - try to find it!  Numbered
fieldnames like "ImageFile1, ImageFile2, ImageFile3" or
"FavoriteUrl[1-17]" should set off warning klaxons.

Finding better design now also makes the future a lot less painful.
If your client suddenly wanted to choose a "preferred" image to show
on the product's main page, you'd have a few different options.

One would be to add a new column to tblProductImages that says which
other column is preferred.  Yuck - you'd have to do something like two
queries or a subquery to find out what the preferred column name was.

Another would be to created a tblPreferredProductImages that kept
track of which column currently kept track of which image is preferred
for a given product.  Again, selects would get ugly and costly.

The design I suggest, and that I think most developers would prefer,
make it easy and elegant.  You'd just add a "Preferred" column to
tblProductImages that was a simple bit flag, and do "SELECT
ImageFileName FROM tblProductImages WHERE productId = #productId# AND
Preferred = 1".  It's elegant, it's quick, and doesn't affect our
existing design or queries in the slightest.  And yes, I skipped using
cfqueryparam to avoid monkeying up the example.

Have a good night, I've finished my beer now.

-- 
For Tabs, Trees, and more, use the jComponents:
http://clearsoftware.net/client/jComponents.cfm

~|
All-in-one: antivirus, antispam, firewall for your PC and PDA. Buy Trend Micro 
PC-cillin Internet Security
http://www.houseoffusion.com/banners/view.cfm?bannerid=60

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190185
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: 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 design has a table that looks like this:

tblProductImages
-
ProductId
ImageFileName1
ImageFileName2
ImageFileName3

If I understand correctly, you'd do this to handle the upload:










And this for your insert:


 INSERT INTO tblProductImages (ImageFileName1, ImageFileName2, ImageFileName3)
 VALUES (...)


And if you needed all image file names:


 SELECT ImageFileName1, ImageFileName2, ImageFileName3
 FROM tblProductImages
 WHERE productId = 


What Scott means by this being a "static" design is that the number of
images per product supported by your application is a static value,
unable to be changed without changing code.  Why trap yourself like
this?  One of the reasons relational databases _exist_ is to avoid
situations like this.

(I'll send part 2 with the solution in a moment)

-- 
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:190184
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: 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 this:

tblProductImages
-
ProductId
ImageFileName1
ImageFileName2
ImageFileName3

If I understand correctly, you'd do this to handle the upload:










And this for your insert:


  INSERT INTO tblProductImages (ImageFileName1, ImageFileName2, ImageFileName3)
  VALUES (...)


And if you needed all image file names:


  SELECT ImageFileName1, ImageFileName2, ImageFileName3
  FROM tblProductImages
  WHERE productId = 


What Scott means by this being a "static" design is that the number of
images per product supported by your application is a static value,
unable to be changed without changing code.  Why trap yourself like
this?  One of the reasons relational databases _exist_ is to avoid
situations like this.

This is a design that would be more of a best practice:

tblProductImages
-
ProductId
ImageFileName

Then, in your app, have a configuration variable that stores how many
images are allowed per product.  Let's say that's stored in a variable
called, well, "maxProductImages".

First, we put our upload and insert into one loop:


  
  
INSERT INTO tblProductImages (ImageFileName)
VALUES ('#cffile.serverfile#')
  


Much more streamlined, and you can just change maxProductImages
instead copying/pasting code, introducting typos, etc.

And if you needed all image file names:


  SELECT ImageFileName
  FROM tblProductImages
  WHERE productId...


Don't let your design box you in.  If you're repeating code, there's
likely to be a better way to do it - try to find it!  Numbered
fieldnames like "ImageFile1, ImageFile2, ImageFile3" or
"FavoriteUrl[1-17]" should set off warning klaxons.

Finding better design now also makes the future a lot less painful. 
If your client suddenly wanted to choose a "preferred" image to show
on the product's main page, you'd have a few different options.

One would be to add a new column to tblProductImages that says which
other column is preferred.  Yuck - you'd have to do something like two
queries or a subquery to find out what the preferred column name was.

Another would be to created a tblPreferredProductImages that kept
track of which column currently kept track of which image is preferred
for a given product.  Again, selects would get ugly and costly.

The design I suggest, and that I think most developers would prefer,
make it easy and elegant.  You'd just add a "Preferred" column to
tblProductImages that was a simple bit flag, and do "SELECT
ImageFileName FROM tblProductImages WHERE productId = #productId# AND
Preferred = 1".  It's elegant, it's quick, and doesn't affect our
existing design or queries in the slightest.  And yes, I skipped using
cfqueryparam to avoid monkeying up the example.

Have a good night, I've finished my beer now.

-Joe

-- 
For Tabs, Trees, and more, use the jComponents:
http://clearsoftware.net/client/jComponents.cfm

~|
Purchase Contribute 3 from House of Fusion, a Macromedia Authorized Affiliate 
and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=53

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190183
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: 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 
anything about uploading the images

do u get that?

like i said in the last one if he wants to do it then he needs to make a hybred 
of what joe and i both put

because joes code is no good without uploading it and mine is no good without 
inserting it.

-- Original Message --
From: "Steve Brownlee" <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Wed, 12 Jan 2005 18:19:02 -0500

>[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
>increases, you (or someone else) have to go back into the code, find out
>where this functionality is, and then add more code.
>
>When coding for something like this, you need to make sure that it can handle
>*any* number of images with grace, rather than taking the client's word for
>it that "it will always be three images, I guarantee it".  Anyone's who
>worked in consulting knows that there's no such thing as a guaranteed spec
>for clients.
>
>-Original Message-----
>From: dave [mailto:[EMAIL PROTECTED] 
>Sent: Wednesday, January 12, 2005 5:56 PM
>To: CF-Talk
>Subject: Re: How to add images to my db the *right* way?
>
>[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 my way uses static images?
>getting info from file fields the last time i can recall isnt "static", joes
>example used "static" images
>
>why dont u actually look at my code and u will see exactly why it wouldnt
>crash if the image count was less then the available fields.
>
>im no pro but please know what the hell ur talking about before u call
>someone "amateur-ish" (i learned that the hard way lol)
>
>joe is a great coder who i respect but we were talking about 2 completely
>diffent parts of the process
>
>
>

~|
Protect Your PC from viruses, hackers, spam and more. Buy PC-cillin with Easy 
Installation & Support 
http://www.houseoffusion.com/banners/view.cfm?bannerid=61

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190160
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: 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
increases, you (or someone else) have to go back into the code, find out
where this functionality is, and then add more code.

When coding for something like this, you need to make sure that it can handle
*any* number of images with grace, rather than taking the client's word for
it that "it will always be three images, I guarantee it".  Anyone's who
worked in consulting knows that there's no such thing as a guaranteed spec
for clients.

-Original Message-
From: dave [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 5:56 PM
To: CF-Talk
Subject: Re: How to add images to my db the *right* way?

[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 my way uses static images?
getting info from file fields the last time i can recall isnt "static", joes
example used "static" images

why dont u actually look at my code and u will see exactly why it wouldnt
crash if the image count was less then the available fields.

im no pro but please know what the hell ur talking about before u call
someone "amateur-ish" (i learned that the hard way lol)

joe is a great coder who i respect but we were talking about 2 completely
diffent parts of the process


~|
Purchase Studio MX with Flash Pro from House of Fusion, a Macromedia Authorized 
Affiliate and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=51

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190152
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: 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 know

but lets start at the top of the page so were are all on the same track! 

~|
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:190149
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: 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 my way uses static images?
getting info from file fields the last time i can recall isnt "static", joes 
example used "static" images

why dont u actually look at my code and u will see exactly why it wouldnt crash 
if the image count was less then the available fields.

im no pro but please know what the hell ur talking about before u call someone 
"amateur-ish" (i learned that the hard way lol)

joe is a great coder who i respect but we were talking about 2 completely 
diffent parts of the process



-- Original Message --
From: Scott Stroz <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Wed, 12 Jan 2005 08:38:21 -0500

>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 PROTECTED]> wrote:
>> > 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
>> 
>
>
>
>-- 
>Scott Stroz
>Boyzoid.com
>___
>Some days you are the dog,
>Some days you are the tree.
>
>

~|
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:190146
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: 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 if i have 
them seperate instead of having to break up a list everytime i only want 1 pic. 
Plus pulling them into flash is much easier when they are seperated.

one other note on the site is it looks good:)
but i would speed up the flash movie so it doesnt jerk like that, using the 
time line for that will give that result if u leave it at the default 12fps 
speed


-- Original Message --
From: Will Tomlinson <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Wed, 12 Jan 2005 06:04:49 -0400

>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 slde them in on the INSERT.  
>
>I've always had good luck with cffile, multiple uploads, etc... but I want to 
>do this with an array because I'm still an amateur rookie, and I wanna learn 
>to do this stuff the right way.
>
>I'll have everything uploaded in the next few days and show you how it works.  
>For now, this is the site...keep in mind nothing works, the 70's music is just 
>for fun right now, the images splashed on the page are so the client can see 
>different pics (the ones to the left are HERS eek!), and how they'll look 
>against black. 
>
>http://209.200.88.199/
>
>Thanks again! Joe too!
>
>THE GAME!  
>
>

~|
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:190141
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: 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 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


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 PROTECTED]> wrote:
> > 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
> 



-- 
Scott Stroz
Boyzoid.com
___
Some days you are the dog,
Some days you are the tree.

~|
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:190077
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


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 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

~|
Purchase Homesite Plus with Dreamweaver from House of Fusion, a Macromedia 
Authorized Affiliate and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=55

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190075
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: 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 slde them in on the INSERT.  

I've always had good luck with cffile, multiple uploads, etc... but I want to 
do this with an array because I'm still an amateur rookie, and I wanna learn to 
do this stuff the right way.

I'll have everything uploaded in the next few days and show you how it works.  
For now, this is the site...keep in mind nothing works, the 70's music is just 
for fun right now, the images splashed on the page are so the client can see 
different pics (the ones to the left are HERS eek!), and how they'll look 
against black. 

http://209.200.88.199/

Thanks again! Joe too!

THE GAME!  

~|
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:190065
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: 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 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%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190041
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: 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%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190029
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


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 only 
copied the 1st 3 just to show the principle of it
u can have as many as u want but the trick is what to do with the serverfile



-- Original Message --
From: Joe Rinehart <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Tue, 11 Jan 2005 16:19:53 -0500

>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 moving on to next one
>> 
>> 
>> 
>> > filefield="picture1"
>> destination="#upload#"
>> nameconflict="makeunique"
>> accept="image/*">
>> 
>> 
>> 
>> 
>> 
>> > filefield="picture2"
>> destination="#upload#"
>> nameconflict="makeunique"
>> accept="image/*">
>> 
>> 
>> 
>> 
>> 
>> > filefield="picture3"
>> destination="#upload#"
>> nameconflict="makeunique"
>> accept="image/*">
>> 
>> 
>> 
>> 
>> -- Original Message --
>> From: Will Tomlinson <[EMAIL PROTECTED]>
>> Reply-To: cf-talk@houseoffusion.com
>> Date:  Tue, 11 Jan 2005 15:21:59 -0400
>> 
>> >>>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 had a use for them 
>> >until now.
>> >
>> >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:190003
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


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 moving on to next one
> 
> 
> 
>  filefield="picture1"
> destination="#upload#"
> nameconflict="makeunique"
> accept="image/*">
> 
> 
> 
> 
> 
>  filefield="picture2"
> destination="#upload#"
> nameconflict="makeunique"
> accept="image/*">
> 
> 
> 
> 
> 
>  filefield="picture3"
> destination="#upload#"
> nameconflict="makeunique"
> accept="image/*">
> 
> 
> 
> 
> -- Original Message --
> From: Will Tomlinson <[EMAIL PROTECTED]>
> Reply-To: cf-talk@houseoffusion.com
> Date:  Tue, 11 Jan 2005 15:21:59 -0400
> 
> >>>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 had a use for them 
> >until now.
> >
> >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:189998
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


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: http://www.houseoffusion.com/lists.cfm/link=i:4:189995
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


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

2005-01-11 Thread Will Tomlinson
>
>
>
>
>
>
>INSERT INTO images (filename)
>VALUES ()
>
>

I've decided to create a makeimageprimary field in the table. It'll be a y- n 
value. How would I loop through a 2d array insert into the table? 

I'm going to give this a shot shortly. Thanks so much Joe!

Will let you know how it comes out. 

Will
>
>
>On Tue, 11 Jan 2005 15:21:59 -0400, Will Tomlinson <[EMAIL PROTECTED]> wrote:
>>

~|
This list and all House of Fusion resources hosted by CFHosting.com. The place 
for dependable ColdFusion Hosting.
http://www.houseoffusion.com/banners/view.cfm?bannerid=11

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189987
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


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






















-- Original Message --
From: Will Tomlinson <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Tue, 11 Jan 2005 15:21:59 -0400

>>>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 had a use for them until 
>now. 
>
>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:189985
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: How to add images to my db the *right* way?

2005-01-11 Thread Joe Rinehart






INSERT INTO images (filename)
VALUES ()



-Joe


On Tue, 11 Jan 2005 15:21:59 -0400, Will Tomlinson <[EMAIL PROTECTED]> wrote:
> >>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 had a use for them until 
> now.
> 
> 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:189981
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


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 had a use for them until 
now. 

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:189980
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


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

~|
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:189899
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


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 insert. 

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:189892
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: 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.


Joe,

One other thing is she wants up to 3 different images per model. Some shorts 
have front, side, and rear shots. How would you arrange those in the schema?

Thanka,
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:189882
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


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 "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.


I agree! What I've done here is insane! Let me rework this. 

Thanks!

~|
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:189880
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: 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 "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.

>From there, the queries to get all images for a product or get the
appropriate images for a product in a given color become fairly simple
and straightforward.

-Joe

-- 
For Tabs, Trees, and more, use the jComponents:
http://clearsoftware.net/client/jComponents.cfm

~|
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:189878
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: 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%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189860
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


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 heres my first thoughts

on ypour seperate tables, i guess i wasnt thinking last email, i would your 
seperate tables for some things, such as colors, sizes, styles, lines.
then fill those with the standards (can be updatable as well), then make one 
table and each record will contain all the info on each piece but it will pull 
a lot of the info from the cfc to fill the table when each piece is entered.
stuff like sizes can be input as a csv

does that make any sense?

-- Original Message --
From: Will Tomlinson <[EMAIL PROTECTED]>
Reply-To: cf-talk@houseoffusion.com
Date:  Mon, 10 Jan 2005 17:42:27 -0400

>> 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 three tables linking up right now. 
>Hang on. I'm gonna just put the schema up on my site. You know, the one that 
>doesn't validate.  :) heehee. 
>
>Ok, got it up there: http://www.wtomlinson.com/schema.htm
>
>It's all working great, except my image db design. It sucks! Lemme know what 
>you think. 
>
>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:189858
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: 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 three tables linking up right now. 
Hang on. I'm gonna just put the schema up on my site. You know, the one that 
doesn't validate.  :) heehee. 

Ok, got it up there: http://www.wtomlinson.com/schema.htm

It's all working great, except my image db design. It sucks! Lemme know what 
you think. 

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:189857
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: 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 will be flash driven the 
basics will be the same.

why loop it to get the info?
are u having troubles uploading more than 1 file field at a time? cause thats a 
bit tricky but is easily done

not sure how u'd do it with your glorified frontpage program though ;)

u remember the glorified windows ME dont ya? was also known as windows 95 ;)

 

~|
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:189854
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


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 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:189845
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


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 hell here and I could NOT pass it up!

;-)


Donna




On Mon, 10 Jan 2005 15:50:38 -0400, Will Tomlinson <[EMAIL PROTECTED]> wrote:
> I'm almost finished with the coding on my clothing e-commerce site, but I'm 
> running into a few minor snags.
> 
> When dealing with images, I usually just add a few image fields in the main 
> table, image1,2,3,etc. It usually works fine and I built this stupidly 
> elaborate process for updating and deleting them. But this clothing db is a 
> little different and the image setup needs to be done right for it all to 
> work as I need.
> 
> Everything revolves around a model of clothing. The tblprodmodels table has: 
> prodmodelcode-PK varchar
> prodsellprice
> title
> category
> etc.
> 
> I also have a tblavailablecolors with
> availablecolorID - PK (int-autnum)
> prodmodelcode  - FK from tblprodmodels
> colorname  FK  from tblallcolors
> 
> tblallcolors is just a lookup or validation table.
> 
> Everything works great with me looping available colors into tblavailable 
> colors with a multiple select menu like so:
> 
>  
>  INSERT INTO tblavailablecolors (colorname, prodmodelcode)
>VALUES ('#FORM.prodcolor#', #FORM.model#)
>  
> 
> 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?
> 
> Actually, I need a new linking table. tblavailableimages? Hell, I'm having a 
> brainfart here! How should I tie in the images for a model? And tie it with a 
> color at the same time?
> 
> GR!!!
> 
> 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:189843
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