Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Database images

New Here ,
Dec 29, 2008 Dec 29, 2008

Copy link to clipboard

Copied

I am developing a online store that i will eventually up load to a hosting account. My question is how to I store the image in my database so that when I upload my database and site to the server the paths to my images stored on my database work. Also I am having trouble displaying my images in dreamweaver from the record set i created from my database. I store the path to my image in my database i.e. c:/doucments and setting/images/123png. Is there a better way to do this?
TOPICS
Server side applications

Views

449
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 30, 2008 Dec 30, 2008

Copy link to clipboard

Copied

ibejaminben wrote:
> My question is how to I store the image in my database so that when I
> upload my database and site to the server the paths to my images stored on my
> database work.

Just store the name of the image in the database. Use HTML to define the
correct path, and use the dynamic text from the database to provide the
filename. For example, in PHP, it might look like this:

<img src="/images/<?php echo $row_recordsetName['image']; ?>" alt="...

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 30, 2008 Dec 30, 2008

Copy link to clipboard

Copied

David thank you for you reply so if my actual images are stored as such c:/documents and settings/images/123png. then i just store the 123pgn. in my database? then do i move those files to my images fold under my site root? how does CF and or dream weaver get the path for each dynamic image? your help is greatly apperciated.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 30, 2008 Dec 30, 2008

Copy link to clipboard

Copied

ibejaminben wrote:
> David thank you for you reply so if my actual images are stored as such
> c:/documents and settings/images/123png. then i just store the 123pgn. in my
> database? then do i move those files to my images fold under my site root?

Yes to both questions.

> how
> does CF and or dream weaver get the path for each dynamic image?

In the same way as you set the path for a normal image. In the Select
Image dialog box, there's a radio button labelled Data Sources (it's a
regular button in the Mac version). Select that, and then select the
dynamic object for the image. That inserts the correct CF code for the
image name. You'll need to add the path to the images folder (followed
by a trailing forward slash) manually. The PHP example I gave you
earlier should be easy enough to adapt to CF.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 30, 2008 Dec 30, 2008

Copy link to clipboard

Copied

LATEST
Thanks David you don't know how long i have been searching for an answer to this question. A heavy weight has been lifted from my shoulders. Before i was storing the whole path to the image in my database i.e a record that went something like this c:/documents and setting/images/123png. Then I build a record set that included the path to that image. When I inserted the field for that record I could never get the image to display it just displayed the path from my database not the actual image. I can't test this out today but i will later this week please check back to see if i have more questions later in the week. Your advice is invaluable thanks

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines