Re: How to call image from mySql to php file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 10:38 AM +0500 2/24/07, Fahad Pervaiz wrote:

There are two ways to store images in databases.

First is that you upload your images to a directory and store path to that
image in the database. In this case make sure that your field size is large
enough to store the complete path. You can use the following code to
retreive the image and display it.

$sno = $_REQUEST['sno'];

$query="SELECT logos FROM table WHERE sno = '$sno' limit 1";

-snip-

$sno = $_REQUEST['sno'];

$query="SELECT logos FROM table WHERE sno = '$sno' limit 1";

-snip-

you can make call to it from you abc.html as follows
<div>
<img src="image.php?sno=<?=$_REQUEST['sno']?>" />
</div>

--
Regards
Fahad Pervaiz
www.ecommerce-xperts.com
(Shopping Carts, Framwork for
Multilingual Web Sites, Web Designs)

Security -- we have a problem.

Never trust any data coming from outside your code.

Also, in that regard, you might want to rethink using $_REQUEST.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux