- create a table in the database
- write an PHP file to upload images
- write an PHP file to view the album
The picture above is the structure of the table in my database.
Let's explain those parameters a little bit.
- id is just an index that will be auto incremented by the system but has no great significance.
- name is the name of the picture you store.
- type is the content type of that image. (e.g. jpeg, gif, or png etc..)
- size is the size(kB or MB) of the image.
- content is the image content. Note here that you have to set the attribute of this to mediumblob in order to store the image in the database.
- album_name is the name of the album that a picture belongs to.
- album_num is the tag of the the album that a picture belongs to.
- pic_num is the index of that picture in the album it belongs to.
- author is the name of the owner of that picture.
- width is the width of that picture.
- height is the height of that picture.
Basically it is the same as you upload a text to the server.
Anyway, we will continue to discuss this in a later time.
No comments:
Post a Comment