LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-06-2006, 02:54 PM   #1
Pravab
Member
 
Registered: Apr 2006
Location: Dharan,Nepal
Distribution: FC5
Posts: 63

Rep: Reputation: 15
upload of image in database (php+mysql)


can anyone provide meh with the code to upload image in database using php and mysql. i dont know how to in linux and couldnt make it in windows.

i wanted which will work for linux : database name is "sims"
Table in which image has to be upoloaded is spersonal and attribute is photo

Last edited by Pravab; 07-06-2006 at 03:03 PM.
 
Old 07-06-2006, 10:48 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Quote:
Originally Posted by Pravab
can anyone provide meh with the code to upload image in database using php and mysql. i dont know how to in linux and couldnt make it in windows.

i wanted which will work for linux : database name is "sims"
Table in which image has to be upoloaded is spersonal and attribute is photo
do you actually mean you want to save an image, like a jpeg, in a database? Or by image do you mean an image of a database, i.e. a database dump?
 
Old 07-06-2006, 11:16 PM   #3
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
You'd probably actually be better off uploading the image to a folder somewhere on your webserver and simply storing it's location in the database. For example, if you upload the image to /home/some_user/public_html/public/upload/image.png then you would save /public/upload/image.png in the database. You can then append that to a url to display the image or append it to the first part of the path to manipulate the image.

The PHP manual has information about how to handle file uploads.

- Micah
 
Old 07-07-2006, 10:31 AM   #4
Pravab
Member
 
Registered: Apr 2006
Location: Dharan,Nepal
Distribution: FC5
Posts: 63

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by BrianK
do you actually mean you want to save an image, like a jpeg, in a database? Or by image do you mean an image of a database, i.e. a database dump?
ya i want to save an image in valid formats like jpg,jpeg,bmp,png(image formats)in a database
 
Old 07-07-2006, 11:51 AM   #5
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
http://www.wellho.net/solutions/php-...-retreive.html
 
Old 11-08-2006, 11:05 AM   #6
Pravab
Member
 
Registered: Apr 2006
Location: Dharan,Nepal
Distribution: FC5
Posts: 63

Original Poster
Rep: Reputation: 15
Thanx MicahCarrick
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
upload image to db "php + mysql" ALInux Programming 1 12-15-2005 11:27 AM
Php search mysql database jamesjoy Programming 4 12-02-2005 07:28 AM
can not upload image to site via php script vinsky2002 Linux - Software 0 03-15-2005 12:27 AM
Upload MySQL database Swift&Smart Linux - Software 4 05-19-2003 03:30 AM
Where Do I Upload PHP, Perl, MySQL, etc..? John_Saunders Linux - Software 4 06-08-2002 04:24 PM


All times are GMT -5. The time now is 06:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration