/    Sign up×
Community /Pin to ProfileBookmark

I’ve never used blob before so this is all new to me but i have a column that is blob and stores the binary code for an image. How would i go abouts displaying the image?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@JaelanDec 16.2004 — Can you give an example of the data that's stored in the blob column?


Jaelan
Copy linkTweet thisAlerts:
@GenixdeaeauthorDec 16.2004 — nm, i found a way to do it, tahnks tho ?
Copy linkTweet thisAlerts:
@GenixdeaeauthorDec 17.2004 — ok, i found away to display the images but i can't get it to work. the images were origonally inserted in msaccess, then i converted that db to mysql(it's got over 1400 items). when i try to display the image it says that the item can't be displayed because it contains errors. anyhelp is appricieated...here is the code[code=php]<?PHP
//This is the page that grabs the img info
require_once("includes.php");
if(isset($_GET["id"])) {
$query = "SELECT * FROM $weapons WHERE ID = '". $_GET["id"] ."'";
$result = mysql_query($query, $dbconn);
if(!mysql_num_rows($result)) {
?>There is no record for that id number.<?PHP
}else{
while($get_img = mysql_fetch_assoc($result)) {
header( "Content-type: image/jpg" );
echo $get_img["Image"];
}
}
}

?>

<?PHP
//this is the page that displays it
<img src="images2.php?id=<?PHP echo $_GET["id"]; ?>">
?>
[/code]
and here is just a little bit of what is contained in the Image column[code=php]0x151c1d00030000000800010014001c00ffffffff50696374757265000001050000030000000400000044494200710400008ffbffff54160000280000002b0000002b00000001001800000000002c160000c40e0000c40e00000000000000000000000104090e[/code]it goes on w/ that for about 13500 characters

Edit:: if you go http://24.21.0.55/ko/includes/images.php?id=1 there it works(an image i uploaded w/ jpg extension) but if you go http://24.21.0.55/ko/includes/images.php?id=130 there, it doesnt work(an image that was already in the database) so it appears that i dont have the right file type. i've tried image/jpg, image/jpeg, image/bmp and image/gif...no luck
×

Success!

Help @Genixdeae spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...