PDA

View Full Version : Need help with displaying dynamic images


pistartech366237
04-07-2009, 03:41 PM
Hello,
I'm novice to PHP, MySQL, and DataAssist. I've created product pages with DataAssist 2. Everything is fine. I'm able to Insert the info into my MySQL database.

However, I do have a problem with displaying the ImageThumb or ItemImage (Large image) on either my result page or on the detail page. I've studied every tutorial on your website, as well as I've purchased the WA Database Training, however, it still doesn't have the exact explanation to how can I do that.

I'm binding my Image placeholder to the correct field in the DB, I'm putting folder name in front of the php code in the Src field.... nothing seems to work.

Please help!!!!

Thank you in advance.

Ray Borduin
04-07-2009, 04:03 PM
put the directory where the image is located as well as the file name in the img src attribute.

something like: <img src="../youruploaddirectory/<?php echo($columnfromDB); ?>">

pistartech366237
04-07-2009, 05:30 PM
Dear Ray,

First of all, thank you so much for your quick reply.

I've tried it and (probably I'm doing something wrong) it still doesn't work - I'm getting the following in the Live View - Image Thumb (instead of the image itself).

Here is what WA Data Assist has put for me there:

<?php echo($row_WADALogo['ItemThumb']); ?><img src="<?php echo $row_WADALogo['ItemThumb']; ?>" alt="ImageThumb" />

The directory, where my images are uploading is:

/Images/

Any suggestions?

Thank you so much in advance.

Best regards,

Paul.

Ian
04-08-2009, 04:47 AM
Hi Paul,

At the moment that code is looking for the image in the same directory as the page it is executed on.

You need to change the line:

<img src="<?php echo $row_WADALogo['ItemThumb']; ?>" alt="ImageThumb" />

to read

<img src="../images/<?php echo $row_WADALogo['ItemThumb']; ?>" alt="ImageThumb" />

but make sure that the relative path is correct for your folder structure.

Cheers
Ian

pistartech366237
04-09-2009, 06:15 PM
Hi Ian,

Thank you very much for replying.

I've tried with your advice.... same problem - it shows the alt text "ItemThumb" and that is it....

I've even tried to rebuild from the scratch all these pages using WA DataAssist 2, and have changed every img src line to what you've told me - same result....

In the Live View - it shows "?" instead of the image... In the browser - it shows "ItemThumb".

I've checked my MySQL database to make sure the field is correct - it is longblob....

Another thing that I've noticed is that the properties of that field are:
"http://mydomainname.com/Images/" which means that it doesn't understand that it has to show the particular image.

Sorry for my ignorance..... I just want to make sure I'm doing everything right.

Thank you in advance.

Best regards,

Paul.

Ray Borduin
04-10-2009, 07:18 AM
Is the image name in the database? If it didn't get inserted properly it wouldn't display properly.

pistartech366237
04-10-2009, 03:11 PM
Hi Ray,

Thank you again for replying.

You are right - it doesn't record into the database the name of the file.

I'm using the WA Digital File Pro server behavior to upload the files into the file fields of my insert.php page. Should I do anything differently?

Please advise.

Thank you very much in advance.

Best regards,

Paul.

Ray Borduin
04-10-2009, 03:40 PM
What are you using for your insert server behavior? You should be using dataassist and binding the file field to the "server file name" value in the bindings panel.

pistartech366237
04-10-2009, 03:55 PM
I'm using WA Digital File Pro and binding it to the file field in the insert form of the insert.php.

However, Dataassist wizard (when it builds the insert.php) it creates the text field in the insert form. Therefore, I'm deleting it and inserting the file field instead.

Please advise.

Thank you so much,

Paul.

pistartech366237
04-10-2009, 06:03 PM
Guys,

Thank you so-so much!!!! I've finally figured it out with your help!!!

It worked!!!!

You are great!!!

Best regards,

Paul.