I need to store both text and images to be stored in the same field? How can this be implemented in php using a mysql database? I have used BLOB to store images in the past . Which datatype should I use for this problem?

And how will this work...?
Actually I am implementing a small questionnaire for my site. So the questions have options which will be sometimes a combination of text and images.Note:there can be multiple images for 1 option and at any position :ie in the beginning of the text ,in the middle of the text and at the end of the text.....How to implement this so that I am able to correctly display the option content with the text and images in the correct order...?

Recommended Answers

All 2 Replies

You can store the HTML for a particular option (text column), if your images are accessible by a path (instead of images stored in a blob).

Store images and text in different columns, use CSS classes for image position and store the CSS class name with the option.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.