[SOLVED] display a image record from a database with a set size

This is a discussion on "[SOLVED] display a image record from a database with a set size" within the PHP Forum section. This forum, and the thread "[SOLVED] display a image record from a database with a set size are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Oct 19th, 2007, 18:20
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] display a image record from a database with a set size

Hello i recently recieved help on how to display a image record from a mysql database into a table located on a php file. The image record is dislpaying but the problem i am having is that i need the image to be displayed at a certain size.

For instance my imagerecord is displaying in a tables with the code below

PHP: Select all

</p>
<table width="200" height="196" border="1">  <tr>    <td><img src="images/<?php echo isset($details['photo']) ? $details['photo'] : ''?>" alt="" /></td>  </tr></table>
  <tr>
I need the image to always be displayed at:

Width 200
Height 196

Could anyone give me a code example using the code above to display the image record from the database at a size of 200 by 196 ?????

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 19th, 2007, 18:23
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

Can you just add that width and height in the HTML?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 19th, 2007, 18:30
Highly Reputable Member
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

Yes...you can do as Karinne said or if you want to do it the php way, you would need to use the GD library
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 19th, 2007, 18:32
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

Yeah ... using ImageMagick or GD would make the images smoother ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 19th, 2007, 18:51
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

I am just currently looking into GD Library!! But could someone give me a code example of how to do it using Html as mentioned by karinne?? Using the code i sent... Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 19th, 2007, 18:57
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

I used the [ code ] tags to add color so you can see ... scroll to the very end

Code: Select all
</p>
<table width="200" height="196" border="1">  <tr>    <td><img src="images/<?php echo isset($details['photo']) ? $details['photo'] : ''; ?>" alt="" width="200" height="196" /></td>  </tr></table>
  <tr>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 19th, 2007, 19:04
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

Fantastic it works!!! Thank you vary much karinne
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 19th, 2007, 19:05
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

Ah! No problem
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 19th, 2007, 19:18
Highly Reputable Member
Join Date: Jul 2006
Location: Devon, England
Posts: 565
Thanks: 0
Thanked 0 Times in 0 Posts
Re: display a image record from a database with a set size

Doing it the php way would be more useful if you have a huge picture which is large in filesize and would take a long time for the browser to download.

With php you could resize the image to a desired size (which would be done on the server very quickly) and the image would be downloaded by the browser much quicker.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] image display php code problem longstand PHP Forum 7 Oct 19th, 2007 17:28
[SOLVED] display image if javascript not enabled Voodoochilli JavaScript Forum 1 Oct 4th, 2007 13:58
Variable record size in MySql? wmw Databases 2 Oct 6th, 2006 17:09
display first only part of a database record. Daddyohhh99 Other Programming Languages 0 Feb 3rd, 2006 14:49
display the number of record exist in the database Monie Databases 1 Aug 24th, 2004 08:10


All times are GMT. The time now is 15:03.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42