0

what is the best way to construct an image table in which each user has his own photo album. what I did so far is create a user table with id, username, name etc. fields. I am confused how to construct the image table which will contain all the photos of the users.

any suggestions

1
  • 1
    as a byte[] if it is possible. Then you just take the file stream and place it in a variable. After that you can use inside the image tag src attribute base 64 encoding. so that way your server script doesnt have to do any processing! This link may help you out! Commented Apr 19, 2014 at 14:38

1 Answer 1

2
CREATE TABLE user_images (
    id INT AUTO_INCREMENT,
    user_id INT REFERENCES user (id),
    image_name VARCHAR(30) NOT NULL,
    image_data BLOB
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.