473,792 Members | 2,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

accessing BLOB from mysql db

hi, i m facing a problem in properly accesing BLOBs from mysql db.
when i display an image stored in the blob field it show some absurd
characters.
i think it is the problem of properly telling browser the mime type of
image of blob field.
that is exactly what my problem is. i do not know how to do that .
any help is appreciated.
Jul 17 '05 #1
4 3439
mir nazim wrote:
hi, i m facing a problem in properly accesing BLOBs from mysql db.
when i display an image stored in the blob field it show some absurd
characters.
i think it is the problem of properly telling browser the mime type of
image of blob field.
that is exactly what my problem is. i do not know how to do that .
any help is appreciated.

maybe you should try sendig a header to the browser:

<?php
header ("Content-type: image/jpeg");
echo "<img src=\"blobparse r.php?imgid=323 2\">";
?>
or whatever the image is like image/png || image/gif
--
Sashi
Jul 17 '05 #2
On 15 Mar 2004 03:49:02 -0800, mi****@yahoo.co m (mir nazim) wrote:
hi, i m facing a problem in properly accesing BLOBs from mysql db.
when i display an image stored in the blob field it show some absurd
characters.

i think it is the problem of properly telling browser the mime type of
image of blob field.
Probably.
that is exactly what my problem is. i do not know how to do that .
any help is appreciated.


header("Content-type: appropriate value goes here");

--
Andy Hassall <an**@andyh.co. uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk > / <http://www.andyhsoftwa re.co.uk/space>
Jul 17 '05 #3
> maybe you should try sendig a header to the browser:

<?php
header ("Content-type: image/jpeg");
echo "<img src=\"blobparse r.php?imgid=323 2\">";
?>
or whatever the image is like image/png || image/gif

actually image will come from the data base
like

$result=mysql_q uery("SELECT * FROM users");
$row=mysql_fetc h_assoc($result );
echo $row['photo'];

do get now guys
please help. i m in a fix
Jul 17 '05 #4
mi****@yahoo.co m (mir nazim) wrote in message news:<42******* *************** ****@posting.go ogle.com>...
maybe you should try sendig a header to the browser:

<?php
header ("Content-type: image/jpeg");
echo "<img src=\"blobparse r.php?imgid=323 2\">";
?>
or whatever the image is like image/png || image/gif

actually image will come from the data base
like

$result=mysql_q uery("SELECT * FROM users");
$row=mysql_fetc h_assoc($result );
echo $row['photo'];

do get now guys
please help. i m in a fix


please help me guys i m depparate
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7101
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and disadvantages of using a MySQL blob field rather than reading the images directly from the file? How does one insert an image into a blob field? Can it be done dynamically? Thank you John
3
7437
by: Sugapablo | last post by:
Is there any PHP function that will allow me to determine the MIME type of a blob stored in MySQL? Specifically, if I'm storing an image as a blob in MySQL, is there any PHP function that can determine whether it's a gif, jpeg, png, etc? -- http://www.sugapablo.com <--music ] http://www.sugapablo.net <--personal ]
0
2328
by: Mark Fisher | last post by:
I cannot seem to store binary data as a BLOB. I used the following to create a table capable of holding a BLOB: CREATE TABLE blob_table ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, binary_stuff BLOB, PRIMARY KEY (id) );
7
11485
by: sime | last post by:
Hi, I have a blob field in a mysql database table. I want to copy a blob from one record to another. I am having trouble transferring the data via a php variable. Maybe I need to addslashes or convert to Hex or something. I've tried a few things but can't quite get it. Here is simplified code. mysql_select_db($dbname, $connection);
3
4728
by: hamvil79 | last post by:
I'm implementig a java web application using MySQL as database. The main function of the application is basically to redistribuite documents. Those documents (PDF, DOC with an average size around 2Mb) are stored in BLOB column. The amount of documents for the first year should not exceed 5/6 Giga, but I cannot make prevision for the next years. Those documents are mainly just accessed (update and delete are not so
2
9001
by: pmz | last post by:
Dear Group, I'm connecting in C# with remote (BSD) MySQL server with ODBC Driver, and I'm trying to find the best sollution in such problem: As I've read on MySQL manual, they have suggested table design including the BLOB-Fieldtype size in UInt64, where they've stored, while inserting, the size of inserted BLOB data. But in the matter of fact, I'm interested if it's necessary to include in table this integer field? Is there any way...
2
6535
by: Vinciz | last post by:
hi guys... im new in java and i would love to learn some of these... basically i got a sample code to retrieve the blob from the mysql. however, i dont really know what to do with these retrieved byte/binary data as i got no idea on how to save them in our pc. For this situation, what i need to do is give the byte/binary data an extension (retrieved from another field in the table) in order to revert back to the original data i had in the...
2
1130
by: applegreenss | last post by:
Is it possible to take the contents of a MySQL DB Table, and somehow put the data into a syntax-correct data file format like a delimited ..txt file, and using PHP parse it as a local c:\ file assuming it was sitting in C:\data.txt ..... so I want to read its contents in a similar method as you would query a DB table .... can you do this the same with a blob of data stored in a .TXT file? If so, how to format .txt & php code -- I would...
0
2137
by: dimitri pater | last post by:
Hi, I am trying to insert an image, which is stored as a blob in MySQL, into a table using Reportlab. I have tried this: from StringIO import StringIO cfoto = StringIO(result) # where result is the 'blob' cfoto.seek(0) foto=cfoto.getvalue
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.