Skip to main content
Inspiring
June 17, 2008
Question

Inputting IMage in MYSQL DB via Dreamweaver

  • June 17, 2008
  • 10 replies
  • 708 views
Hey,

Is there a way of inserting an image into a mysql db directly from dreamweaver without having to hand code it? I know how to use recordsets etc i.e. for creating comments forms that post to db etc but what about adding a picture into the db rather than words?..for example..a photo gallery? Any ideas?

Thanks

Shelley
This topic has been closed for replies.

10 replies

Inspiring
June 18, 2008
shelleyfish wrote:
> Hey Dooza,
>
> Had a brain wave in the night and have sorted a solution. I basically created
> a form which has the php upload as part of it. The user can browser to find
> the file which on submitting the form uploads the file to a folder on my server
> and in turn writes the file path to the database. Then in my recordset I bind
> the imgsrc to the image to make it output dynamic..works a treat...thanks for
> all your thoughts!
>
> Shelley

My brain waves normal occur when I have a shower in the morning :) I am
glad you got it working.

Good luck!

Steve
July 20, 2008
Hi,

I wondered whether you could help me. So far I'm able to insert an image to a directory using PHP Upload. Yet I can't seem to get the mysql database to record the file path.

I'm creating an input form so users can upload 1 - 3 photos and then mysql record this data so on their page profile the img uploaded is displayed through img src.

Any help would be greatly appreciated.

Thanks

John
Inspiring
June 18, 2008
Hey Dooza,

Had a brain wave in the night and have sorted a solution. I basically created a form which has the php upload as part of it. The user can browser to find the file which on submitting the form uploads the file to a folder on my server and in turn writes the file path to the database. Then in my recordset I bind the imgsrc to the image to make it output dynamic..works a treat...thanks for all your thoughts!

Shelley
Inspiring
June 17, 2008
shelleyfish wrote:
> Hey heres the link:
>
> http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=702022

Hmmm, I tried to find some documentation on the authors website about
integrating it with an insert behaviour but couldn't find anything at all.

You need something more tightly integrated with Dreamweaver, I am sure
there are some more PHP upload extensions for Dreamweaver, I will try to
help you look for one. As I am an ASP developer not PHP I won't be much
help in using it, but I can try to steer you in the right direction :)

Steve
Inspiring
June 17, 2008
Inspiring
June 17, 2008
shelleyfish wrote:
> I've got a comments form which uploads comments to my db and a separate form to
> upload an image to an images folder.
>
> I have a repeating region on the comments page to display the comments that
> have been posted. I'd really like to design each comment so that the user can
> add a picture with their comments - i.e. avatar sort of thing.
>
> Hope that makes sense? Really appreciate your help with this...I've been
> spending the last few days trying to figure this out and my heads starting to
> hurt :0(
>
> Shelley

You can have one form, which has the comments data and the image upload
script. Your comments table will have an additional field that stores
the image filename. When you display the comment, you pull the filename
from the table, put it into an img tag, and dynamically display the
image with the comment.

Which component are you using to do the upload? Have you a link to the
developers website?

Steve
Inspiring
June 17, 2008
I've got a comments form which uploads comments to my db and a separate form to upload an image to an images folder.

I have a repeating region on the comments page to display the comments that have been posted. I'd really like to design each comment so that the user can add a picture with their comments - i.e. avatar sort of thing.

Hope that makes sense? Really appreciate your help with this...I've been spending the last few days trying to figure this out and my heads starting to hurt :0(

Shelley
Inspiring
June 17, 2008
shelleyfish wrote:
> At the moment I'm actually using php upload componet from the dreamweaver
> exchnage which is uploading the image to a folder on my server...however rather
> than that I want it to upload to my db...if that makes sense?

You really don't want to do it that way, your db will get big very
quickly, its not recommended and I don't know any scripts that will do
that.

Why don't you want to do it the way you already are? Is there a problem
that you can not solve?

Steve
Inspiring
June 17, 2008
At the moment I'm actually using php upload componet from the dreamweaver exchnage which is uploading the image to a folder on my server...however rather than that I want it to upload to my db...if that makes sense?
Inspiring
June 17, 2008
Yes, I'd like to be able to upload an image [or link to image] into my database and then I'll be using a recordset to pull the image onto the page in dreamweaver.
Shelley
Inspiring
June 17, 2008
shelleyfish wrote:
> Hey,
>
> Is there a way of inserting an image into a mysql db directly from dreamweaver
> without having to hand code it? I know how to use recordsets etc i.e. for
> creating comments forms that post to db etc but what about adding a picture
> into the db rather than words?..for example..a photo gallery? Any ideas?
>
> Thanks
>
> Shelley

You don't want to store the photos in the database, it soon gets very large.

You need an upload component or script, or better yet, a gallery script.
Once you have chosen your server language (asp, php, .net, or cf) you
can then hunt for a good script or component. Some of the ones you pay
for will be better, as you will get support and updates, but some of the
free ones can be just as good.

Steve
Inspiring
June 17, 2008
Hey Steve,

I'm using php...can you recommend a good component [free] that will do the job?

Thanks

Shelley