473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to display all images from MYSQL using PHP

selvasoft
I want to display all images from my MYSQL database using PHP coding.The table having name,size,type,content fields. Please any one help me.

Expand|Select|Wrap|Line Numbers
  1. while($row=mysql_fetch_row($imgresult))
  2. {
  3.     header("Content-type: image/jpeg");
  4.     echo "$row[0]";
  5. }    
Am using above code to display one image from table. But i dont know to display more than one images on browser. Please any one help me.
May 2 '12 #1
1 1613
johny10151981
1,059 1GB
dont use this way,
write your code this way

Expand|Select|Wrap|Line Numbers
  1. while($row=mysql_fetch_row($imgresult))
  2. {
  3.     save_image_to_file($row[0],$filename);
  4.     display_image_in_htmlway($filename);
  5. }    
  6.  
May 3 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Dafna m | last post by:
Please HELP 1. How can I display an array of images from diffrent types(jpeg, bmp..)(In C#) Can I also display video files?(In C#) *** Sent via Developersdex http://www.developersdex.com...
2
by: TaeHo Yoo | last post by:
Would anyone be able to tell me how to display images dynomically from the database? I am using dataset which contains supplier name and supplier images. I can display supplier name but supplier...
4
by: Alek Davis | last post by:
Hi, This must be simple, but I can't quite figure out how I can display images in a header of a datagrid. For example, I need to display text followed by the sort button (which is one of two...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
2
by: Randy | last post by:
Hi, I have a small table - 2 columns, 5 rows. Col 1 is the key column and has integer values of 1 through 5. Column 2 is a varbinary(MAX) column and has jpg images loaded in it. What I want...
2
by: pozze | last post by:
Hi, I need to display images and other record information retrieved from an SQL 2005 database in a datagrid on a web page. I'm coding in VB .net I have recently changed over from VB ASP and i'm...
2
by: ashraf02 | last post by:
hi i am trying to display an image using mysql and php. basically i am doing a project which consists of making a storefront. i don't know how to display images i've searched for answers via google...
14
anfetienne
by: anfetienne | last post by:
Hi, i went through a tutorial on how to display images stored with a directory and it came out good but i have a problem.....when i upload less than 5 files it displays the 1 image and then shows...
1
by: harish81 | last post by:
Hi, Please help me to get images in table format. I'm new to PHP. I have written code to display images in a table format and it displays only 9 images in a single page. when i click Next Url to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.