Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Need help inserting Picture and Text in MySQL using PHP

inserting picture and text in mysql table



7:33 am on Apr 17, 2012 (gmt 0)

Hey Guys
I am new here.

I am working on a site with two main pages. the first page is used to collect and stores people's information in a database while the second page displays these information from the database.

I need some help with a php code to store and another to display the following form fields in a MySQL data base
First Name (TEXT)
Last Name (TEXT)
E mail (TEXT)
Photo (IMAGE not exceeding 100Kb)



4:57 pm on Apr 17, 2012 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Yeah you need some code all right. A substantial chunk of it, and an understanding of encoding type for file uploads for the images. It's not a one-off bit of code but a series of bits and pieces, and one post isn't going to cut it.

From what you've told us so far, don't name your database fields with spaces. Use something like fname or first_name or similar. The second is, don't store your images directly in the database as blob columns (to my knowledge, there is no "image" database column type in mySQL.) There are at least a doesn't reasons not to do this - what you should store is the URL or path to the image, and store the image files in your file system in some logical and expandable fashion. E.g., don't just dump them loosely in an "uploads" folder - devise a scheme to organize them in subfolders. The reason being, as you get more and more files, your site will begin slowing down when you have lots of files loose in a single folder.

And there you have one more reason why no one can post a bit of code to do this for you, you'll have to just begin and share with us what's not working. THAT the members here can help you with.

Featured Threads

Hot Threads This Week

Hot Threads This Month