LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   upload of image in database (php+mysql) (https://www.linuxquestions.org/questions/programming-9/upload-of-image-in-database-php-mysql-461581/)

Pravab 07-06-2006 02:54 PM

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

BrianK 07-06-2006 10:48 PM

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?

MicahCarrick 07-06-2006 11:16 PM

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

Pravab 07-07-2006 10:31 AM

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

MicahCarrick 07-07-2006 11:51 AM

http://www.wellho.net/solutions/php-...-retreive.html

Pravab 11-08-2006 11:05 AM

Thanx MicahCarrick
:)


All times are GMT -5. The time now is 01:34 AM.