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

Problem when displaying images when working with PHP, mysql and dreamweaver in a brower

New Here ,
Jul 24, 2006 Jul 24, 2006
Hey Guys

I am new to dynamic development but I already did some research and tutorials about how to get a dynamic web site working with PHP and Mysql in Dreamweaver. I set up a test page to view some content on it directly from the mysql database and it worked just fine in dreamweaver only when I pressed the live data view.

When I tried to view the same page using the browser preview with firefox and internet explorer, plain text from the database was correctly displayed on the brower but the images were absent.

In the mysql database I used the varchar as my picture data type field so that I will refer in dreamweaver in the data binding panel in the img.src to the picture column of my database.

I anyone can tell me what am I doing wrong so that my pictures are not displayed in the browser when i click the browser preview facility in dreamweaver I would be very very and very pleased ! 🙂
TOPICS
Server side applications
495
Translate
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 ,
Jul 24, 2006 Jul 24, 2006
The odds are that it is the way that you have referenced the images rather
than an issue with the database. If you have the images root relative like
this "/images" then they will work in preview, and on the webserver, but
will not view when looking at the file via localhost.

If possible make the links page relative and then they should work fine.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"mariosal026" <webforumsuser@macromedia.com> wrote in message
news:ea3nq2$9ol$1@forums.macromedia.com...
> Hey Guys
>
> I am new to dynamic development but I already did some research and
> tutorials
> about how to get a dynamic web site working with PHP and Mysql in
> Dreamweaver.
> I set up a test page to view some content on it directly from the mysql
> database and it worked just fine in dreamweaver only when I pressed the
> live
> data view
.
>
> When I tried to view the same page using the browser preview with firefox
> and
> internet explorer, plain text from the database was correctly displayed on
> the
> brower but the images were absent.
>
> In the mysql database I used the varchar as my picture data type field so
> that
> I will refer in dreamweaver in the data binding panel in the img.src to
> the
> picture column of my database.
>
> I anyone can tell me what am I doing wrong so that my pictures are not
> displayed in the browser when i click the browser preview facility in
> dreamweaver I would be very very and very pleased ! :)
>


Translate
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 ,
Jul 25, 2006 Jul 25, 2006


--- If possible make the links page relative and then they should work fine.

my root folder is called 'dynamicsite' and the images folder is found in dynamicsite/images/(my images)

is this code below correct ? Is it relative to the web root folder?

<td width="25%"> </td>
<td width="25%"> </td>
<td width="50%"><img src="/images/<?php echo $row_rsCustomers['Picture']; ?>" /></td>
</tr>
<tr>

Thanks again

mariosal026
Translate
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 ,
Jul 25, 2006 Jul 25, 2006
mariosal026 wrote:
> my root folder is called 'dynamicsite' and the images folder is found in
> dynamicsite/images/(my images)
>
> <td width="50%"><img src="/images/<?php echo
> $row_rsCustomers['Picture']; ?>" /></td>

When you're testing locally, the root becomes http://localhost.

The code you're using resolves to http://localhost/images/

To resolve to the correct address, remove the slash from the beginning
of the src attribute like this:

<img src="images/<?php echo $row_rsCustomers['Picture']; ?>" />

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Translate
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 ,
Jul 25, 2006 Jul 25, 2006
mariosal026 wrote:
> In the mysql database I used the varchar as my picture data type field so that
> I will refer in dreamweaver in the data binding panel in the img.src to the
> picture column of my database.

Are you storing the pictures in the database or just the pathnames?

If you're storing the actual pictures, 1) it's a bad idea, and 2)
VARCHAR is for text - the correct data type for images is BLOB.

If you do store images in the database, you need to create a separate
script to extract them from the database and send the correct MIME
headers to the browser. It's complicated and messy.

If you're storing the pathname, it's probably as Paul says, the path
isn't resolving correctly.

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Translate
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 ,
Jul 25, 2006 Jul 25, 2006
still with the code I used above images are not being displayed when clicking F12 to show my results in the browser.

thanks again
Translate
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 ,
Jul 25, 2006 Jul 25, 2006
I hasn't worked neither.

I think I will start the page all over again


I will contact you for any other difficulties

Thanks
Translate
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 ,
Jul 25, 2006 Jul 25, 2006
Still not working

I am using a folder called dynamicsite insite the www folder of the wamp5 server.

Is it the problem?

What I am finding strange is that when I view the page source after I preview the web page the image html coding is correct.
Translate
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 ,
Jul 25, 2006 Jul 25, 2006
mariosal026 wrote:
> I am using a folder called dynamicsite insite the www folder of the wamp5
> server.
>
> Is it the problem?

Sorry, I don't know the details of a wamp5 setup, but if www is the
server root, it should be OK.

> What I am finding strange is that when I view the page source after I preview
> the web page the image html coding is correct.

If that's the case, it sounds as though the image isn't in the images
folder.

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Translate
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 ,
Jul 27, 2006 Jul 27, 2006
LATEST
I had a bad link to my image folder : ))

I was doing the link relative to the folder set in dreamweaver when creating a new site instead of the www root folder.

Thanks for your help.
Translate
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