473,418 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

how to store the image in database using php

hello guys,
i need your help...
i face problem in storing image in database...
can any one send me the complete coding of storing image in database...
please i need ur help...
plz try to send me complete coding of stroing image file in php...

thanks and regards
Vivek Goyal
Sep 17 '07 #1
3 1718
gregerly
192 Expert 100+
hello guys,
i need your help...
i face problem in storing image in database...
can any one send me the complete coding of storing image in database...
please i need ur help...
plz try to send me complete coding of stroing image file in php...

thanks and regards
Vivek Goyal
Hi vivekgoyal,

We are here to help you when you have questions with projects you might be working on, not to do your projects for you. I'de be more than willing to help you if you have some code you want some help on. Post what you have so far and we can go from there.

Thanks,

greg
Sep 17 '07 #2
hello guys,
i need your help...
i face problem in storing image in database...
can any one send me the complete coding of storing image in database...
please i need ur help...
plz try to send me complete coding of stroing image file in php...

thanks and regards
Vivek Goyal
I wouldn't ask for code, its better to understand what your are doing yourself. Plus it may not be compatabile with what you already have

Firstly i wouldn't store the images in a db, i would store the path to the image in the db and then retreive when you need it. i think you'll find thats simpler.
Sep 17 '07 #3
aktar
105 100+
Hi Vivek

It really very easy: all you do is prepare a a DB slot(long blob) and store in it your image handle. The code below assumes you know how to upload using HTML

[php]


$handle = fopen($_FILE['file']['tmp_name'], "r");

$sql = "INSERT INTO image (image, .... ......) ";
$sql .= "VALUES ('$handle' .. .....)";

//then insert and WALLA!!! there you have it

[/php]


But I wouldnt recomment this method for many reasons. Instead you should store the image as a file and put the NAME of the image into the DB

This might help you, as it has complete example codes

http://www.codewalkers.com/c/a/Datab...s-in-Database/
Sep 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Karen Grube | last post by:
Hi! Each week, we receive a two-page PDF file from UPS along with a separate flat file (a CSV) The PDF file contains the overview of our weekly invoice and the CSV contains the details of each...
2
by: Tim Zych | last post by:
How would I go about storing data files on my web host? I have an Access database driven website and I would like to save files and be able to download them. Can somebody point me in the right...
6
by: Rudy | last post by:
Hello all! I am amazed how many posts I have read to store an image in SQL, and just as many against it. So I learned how to store an image in a SQL db and retrieve the image. A little tricky,...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
10
by: Peter Stojkovic | last post by:
I want store an integer-array of 1000 Values in a blob in a SQL-database. I will do this every 10 Seconds. How can I do this ???? What datatypes a have to use ??? Thanks
4
by: serge | last post by:
I was working on figuring out where a certain application was storing the multiple selection choices I was doing through the app. I finally figured out that they were being store in an IMAGE data...
1
by: nwebhosting | last post by:
Hello and thank you. Could you please help me with this.: i try to store images using the following code, and it just bring a blank screen. i being trying different things and i am not sure if...
0
by: Skiran | last post by:
Hi to everybody, I am handling a large-scale project of MIS (Marketing information System). I am using Vb 6 as front end, Ms Access as back end and Crystal report 8 as reporting tool. 1)...
6
by: Keith Hughitt | last post by:
Hi all, I've run into a strange error while trying to store some PNG images in a MySQL database using MySQLdb. When I try to insert smaller images (< 64kb or so) everything seems to work fine....
2
by: gm000 | last post by:
hi i m using radiobuttonlist with images like this <asp:RadioButtonList ID="rbtnthumb1" runat="server"> <asp:ListItem Value ="News_icon.jpg"> <img...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
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...
0
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...
0
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...

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.