Forum Moderators: coopster

Message Too Old, No Replies

how to add image into MySQL

         

dejavu

8:44 am on Sep 3, 2004 (gmt 0)

10+ Year Member



I'm trying to create simple web database wit name, surname and users picture.
The problem is that I (or any user) can't upload picture and show it.
I know that there is the way to store picture somewhere on the server and call it later but I don't know how to do it.
Can someone provide Me some code?

Thank's for any help.
Dejan
Croatia

Lord Majestic

8:47 am on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd say you will be better off storing name/dob/whatever in database and store images in normal files, with filename being recorded in database. This should provide better performance (especially if you don't have persistent database connections).

dejavu

8:52 am on Sep 3, 2004 (gmt 0)

10+ Year Member



That's what I like to do but I don't know how to do that :(
Does anybody have some sample code?

tomda

9:00 am on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sample code?

You 'll need more than one code/file (login, registration, uploading files) and you will also need to deal with sessions.

Go to PHPfreaks tutorial pages and get the tutorials on "Membership system" and "Simple Form-Based Image Upload" . Everything is in there to have a good start (this is the one I used when I was PHP newbie)

mincklerstraat

9:27 am on Sep 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'd also do well to look at a lot of the existing scripts that look real simple, and dive into their code. Check hotscripts, surf to demo versions to see if it's doing what you want, then download. Also, read up on security in php & mysql as a lot of free scripts ignore important security issues and you certainly don't want to get hacked.