hi all,
i need to display the images that are saved in the back end. so can any one help me please....

$sql="select * from images";
     mysql_error();  
     $result=mysql_query($sql);

after this wat should be done to display the result obtained images.

Recommended Answers

All 4 Replies

Well more information is needed? Are the images stored in the database themselves or do you have a field in the db that just points to the file location and filename?

Hello

I have tackled this problem before, so I can tell you what to do.
Assuming that the images are stored in a database:

<?php
$con = mysql_connect ( $server, $uname, $pass );
if ( !$con )
  die ( mysql_error() );
mysql_select_db ( "images" );
$query = "SELECT * FROM 'images' WHERE 'name' = " . $_GET["name"];
$q = mysql_query ( $query );
if ( !$q )
  die ( mysql_error() );
$row = mysql_fetch_array ( $q );
header ( "Content-type: " . $row["mime"] );
echo $row["data"];
mysql_close ( $con );
?>

If the images are simply referenced in a database, then use a loop to extract the names and generate an <img> tag for each of them.

Hope this helps

hi everybody
and how about if images are not stored

Images must be stored some where to get it display.
It may be 3 case:
- you can save image in folder
- in database
- you can directly use external link like http://www.abc.jpf as a image src.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.