Jump to content

How to display GIF from MYSQL in PHP?


mich
 Share

Recommended Posts

First, thanks for taking a look at my post.actually, i'm quite rookie in PHP MYSQL.currently, i'm having this problem. i cant seem to be able to find any help on displayingthe GIF format image where i stored in the MYSQL database as "mediumblob".I've seen many site that teach me the usage of path. but the website i'm working needs the usage of retrieving directly from DATABASE.here's my script sample :(i've select the details, and other details has been called out just the way i expected)but only the image part give me the problems..)<?php...........$sql = "SELECT T_ID, T_NAME, T_PATH, T_GIF, T_CN_CHAR FROM TIANGAN ORDER BY T_ID ASC;";$result = doSql($sql);$query_data = mysql_fetch_row($result);if($result = doSql($sql)){echo "<table width=100% border=0 >";echo "<td width='15%' height='40' align='left'><b><font face='Arial' size =3>Date</b></td><td width='35%' height='40' align='left' ><b><font face='Arial' size =3>Events</b></td><td width='50%' height='40' align='left'><b><font face ='Arial' size =3>Description</b></td></tr>";while($query_data = mysql_fetch_array($result)){$eventid = $query_data[T_ID];echo "<td valign=top><font face='Arial' size ='2'>$query_data[T_NAME]<br><br></td>";header("Content-Type: image/GIF");echo $query_data[T_GIF];......Please HELP?? unsure.gif

Link to comment
Share on other sites

You'd end up having to change the values to your specifications:

$get_img=mysql_fetch_array(mysql_query("SELECT img_url FROM tablename"));// You can split this up into three steps if you want, but it isn't neccesary.echo "<img src='$get_img[img_url]' />";

Providing it is alreayd in your database.

Link to comment
Share on other sites

Thanks, Armed Rebel. i'll try it. thank you once more.. :):)

You'd end up having to change the values to your specifications:
$get_img=mysql_fetch_array(mysql_query("SELECT img_url FROM tablename"));// You can split this up into three steps if you want, but it isn't neccesary.echo "<img src='$get_img[img_url]' />";

Providing it is alreayd in your database.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...