Display image from mysql in php


<?php
header("content-type:image/jpg");
//include main.php;
$id = $_GET["id_level"];
$con=mysql_connect("localhost","name","")or die("cant connect to mysql");
mysql_select_db("pramodh");
$query = "SELECT IMAGE FROM reg WHERE id_level='$id'"or die (mysql_error());
$result = mysql_query($query);
$row = mysql_fetch_array($result,0);
ECHO "$row[IMAGE]";
?>
Advertisements
About

myself pramodh kumar yet another php developer from India and have worked on oops,procedural,yii framework,codeigniter,wordpress,joomla,api and more.

Tagged with: , , , ,
Posted in Display image from mysql in php, php

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow php tutorial on WordPress.com
categories
Calendar
June 2012
M T W T F S S
    Jul »
 123
45678910
11121314151617
18192021222324
252627282930  
Follow me on Twitter
Blog Stats
  • 73,826 hits
%d bloggers like this: